summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
Diffstat (limited to 'uui')
-rw-r--r--uui/IwyuFilter_uui.yaml2
-rw-r--r--uui/Library_uui.mk3
-rw-r--r--uui/inc/ids.hrc7
-rw-r--r--uui/inc/ids.hxx2
-rw-r--r--uui/inc/strings.hrc16
-rw-r--r--uui/source/iahndl-authentication.cxx9
-rw-r--r--uui/source/iahndl-errorhandler.cxx48
-rw-r--r--uui/source/iahndl-locking.cxx64
-rw-r--r--uui/source/iahndl-ssl.cxx32
-rw-r--r--uui/source/iahndl.cxx178
-rw-r--r--uui/source/iahndl.hxx41
-rw-r--r--uui/source/interactionhandler.cxx18
-rw-r--r--uui/source/logindlg.cxx9
-rw-r--r--uui/source/logindlg.hxx2
-rw-r--r--uui/source/masterpasscrtdlg.cxx32
-rw-r--r--uui/source/masterpasscrtdlg.hxx3
-rw-r--r--uui/source/openlocked.cxx60
-rw-r--r--uui/source/openlocked.hxx30
-rw-r--r--uui/source/passwordcontainer.cxx2
-rw-r--r--uui/source/passwordcontainer.hxx4
-rw-r--r--uui/source/readonlyopen.cxx38
-rw-r--r--uui/source/readonlyopen.hxx35
-rw-r--r--uui/source/reloadeditable.cxx1
-rw-r--r--uui/source/requeststringresolver.cxx4
-rw-r--r--uui/source/requeststringresolver.hxx6
-rw-r--r--uui/source/secmacrowarnings.cxx111
-rw-r--r--uui/source/secmacrowarnings.hxx4
-rw-r--r--uui/source/unknownauthdlg.cxx1
-rw-r--r--uui/source/unknownauthdlg.hxx1
-rw-r--r--uui/uiconfig/ui/macrowarnmedium.ui122
-rw-r--r--uui/uiconfig/ui/setmasterpassworddlg.ui70
31 files changed, 461 insertions, 494 deletions
diff --git a/uui/IwyuFilter_uui.yaml b/uui/IwyuFilter_uui.yaml
index 20e352baa1bf..d1cb97420d49 100644
--- a/uui/IwyuFilter_uui.yaml
+++ b/uui/IwyuFilter_uui.yaml
@@ -3,7 +3,7 @@ assumeFilename: uui/source/iahndl.cxx
excludelist:
uui/inc/ids.hxx:
# Needed by macro defines
- - vcl/errcode.hxx
+ - comphelper/errcode.hxx
uui/source/iahndl.cxx:
# Actually used
- com/sun/star/awt/XWindow.hpp
diff --git a/uui/Library_uui.mk b/uui/Library_uui.mk
index 4f664ac20dba..a04f3de5b051 100644
--- a/uui/Library_uui.mk
+++ b/uui/Library_uui.mk
@@ -14,7 +14,7 @@ $(eval $(call gb_Library_set_include,uui,\
-I$(SRCDIR)/uui/inc \
))
-$(eval $(call gb_Library_set_componentfile,uui,uui/util/uui))
+$(eval $(call gb_Library_set_componentfile,uui,uui/util/uui,services))
$(eval $(call gb_Library_use_external,uui,boost_headers))
@@ -62,7 +62,6 @@ $(eval $(call gb_Library_add_exception_objects,uui,\
uui/source/openlocked \
uui/source/passwordcontainer \
uui/source/passworddlg \
- uui/source/readonlyopen \
uui/source/reloadeditable \
uui/source/requeststringresolver \
uui/source/secmacrowarnings \
diff --git a/uui/inc/ids.hrc b/uui/inc/ids.hrc
index 89fb6bda1dcb..acbb0bfcd763 100644
--- a/uui/inc/ids.hrc
+++ b/uui/inc/ids.hrc
@@ -19,13 +19,14 @@
#pragma once
-#include <vcl/errcode.hxx>
+#include <unotools/resmgr.hxx>
+#include <comphelper/errcode.hxx>
#include <utility>
#include "ids.hxx"
-#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
+#define NC_(Context, String) TranslateId(Context, u8##String)
const std::pair<TranslateId, ErrCode> RID_UUI_ERRHDL[] =
{
@@ -37,7 +38,7 @@ const std::pair<TranslateId, ErrCode> RID_UUI_ERRHDL[] =
ERRCODE_UUI_IO_ALREADYEXISTS },
{ NC_("RID_UUI_ERRHDL", "Target already exists."),
ERRCODE_UUI_IO_TARGETALREADYEXISTS },
- { NC_("RID_UUI_ERRHDL", "You are about to save/export a password protected basic library containing module(s) \n$(ARG1)\nwhich are too large to store in binary format. If you wish users that don't have access to the library password to be able to run macros in those module(s) you must split those modules into a number of smaller modules. Do you wish to continue to save/export this library?"),
+ { NC_("RID_UUI_ERRHDL", "You are saving a password protected Basic library containing the following large module(s): \n$(ARG1)\nStoring those large module(s) in binary format, which is necessary for password protection, makes them unreadable in versions older than LibreOffice 5.0.3. If you want to avoid this please split the module into smaller pieces."),
ERRCODE_UUI_IO_MODULESIZEEXCEEDED },
{ NC_("RID_UUI_ERRHDL", "Beware!\n\nYou are about to load a very unusual sort of file ($(ARG2)) from the URL:\n\n$(ARG1)\n\nAre you certain that this file is a legacy document created many years ago?"),
ERRCODE_UUI_IO_EXOTICFILEFORMAT },
diff --git a/uui/inc/ids.hxx b/uui/inc/ids.hxx
index 32ba356a4ee5..3534979f5cbb 100644
--- a/uui/inc/ids.hxx
+++ b/uui/inc/ids.hxx
@@ -19,7 +19,7 @@
#pragma once
-#include <vcl/errcode.hxx>
+#include <comphelper/errcode.hxx>
#define ERRCODE_UUI_IO_ABORT ErrCode(ErrCodeArea::Uui, 0)
#define ERRCODE_UUI_IO_ACCESSDENIED ErrCode(ErrCodeArea::Uui, 1)
diff --git a/uui/inc/strings.hrc b/uui/inc/strings.hrc
index 8eaa68cb23f6..66cc704e97fb 100644
--- a/uui/inc/strings.hrc
+++ b/uui/inc/strings.hrc
@@ -19,7 +19,7 @@
#pragma once
-#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
+#define NC_(Context, String) TranslateId(Context, u8##String)
#define STR_ENTER_PASSWORD_TO_OPEN NC_("STR_ENTER_PASSWORD_TO_OPEN", "Enter password to open file: \n")
#define STR_ENTER_PASSWORD_TO_MODIFY NC_("STR_ENTER_PASSWORD_TO_MODIFY", "Enter password to modify file: \n")
@@ -47,12 +47,7 @@
#define STR_LOCKFAILED_OPENREADONLY_BTN NC_("STR_LOCKFAILED_OPENREADONLY_BTN", "Open ~Read-Only")
#define STR_LOCKFAILED_OPENREADONLY_NOTIFY_BTN NC_("STR_LOCKFAILED_OPENREADONLY_NOTIFY_BTN", "~Notify")
-#define STR_OPENLOCKED_TITLE NC_("STR_OPENLOCKED_TITLE", "Document in Use")
-#define STR_OPENLOCKED_MSG NC_("STR_OPENLOCKED_MSG", "Document file '$(ARG1)' is locked for editing by:\n\n$(ARG2)\n\nOpen document read-only or open a copy of the document for editing.\nSelect Notify to open read-only and get notified when the document becomes editable.$(ARG3)")
-#define STR_OPENLOCKED_ALLOWIGNORE_MSG NC_("STR_OPENLOCKED_ALLOWIGNORE_MSG", "\nYou may also ignore the file locking and open the document for editing.")
-#define STR_OPENLOCKED_OPENREADONLY_BTN NC_("STR_OPENLOCKED_OPENREADONLY_BTN", "Open ~Read-Only")
-#define STR_OPENLOCKED_OPENREADONLY_NOTIFY_BTN NC_("STR_OPENLOCKED_OPENREADONLY_NOTIFY_BTN", "~Notify")
-#define STR_OPENLOCKED_OPENCOPY_BTN NC_("STR_OPENLOCKED_OPENCOPY_BTN", "Open ~Copy")
+#define STR_OPENLOCKED_HIDDEN_DATA NC_("STR_OPENLOCKED_HIDDEN_DATA", "Document Name: $(ARG1)\nUser Name: $(ARG2)")
#define STR_UNKNOWNUSER NC_("STR_UNKNOWNUSER", "Unknown User")
#define STR_FILECHANGED_TITLE NC_("STR_FILECHANGED_TITLE", "Document Has Been Changed by Others")
@@ -83,10 +78,7 @@
#define STR_RELOADEDITABLE_TITLE NC_("STR_RELOADEDITABLE_TITLE", "Document is now editable")
#define STR_RELOADEDITABLE_MSG NC_("STR_RELOADEDITABLE_MSG", "Document file '$(ARG1)' is now editable \n\nReload this document for editing?")
#define STR_RELOADEDITABLE_BTN NC_("STR_RELOADEDITABLE_BTN", "~Reload")
-
-#define STR_READONLYOPEN_TITLE NC_("STR_READONLYOPEN_TITLE", "Document is read-only")
-#define STR_READONLYOPEN_MSG NC_("STR_READONLYOPEN_MSG", "Document file '$(ARG1)' is read-only.\n\nOpen read-only or select Notify to open read-only and get notified when the document becomes editable.")
-#define STR_READONLYOPEN_BTN NC_("STR_READONLYOPEN_BTN", "Open ~Read-Only")
-#define STR_READONLYOPEN_NOTIFY_BTN NC_("STR_READONLYOPEN_NOTIFY_BTN", "~Notify")
+#define STR_LOADREADONLY_MSG NC_("STR_LOADREADONLY_MSG", "The author would like you to open '$(ARG1)' as read-only unless you need to make changes. Open as read-only?")
+#define STR_VERIFY_CERT NC_("STR_VERIFY_CERT", "You need to view the certificate first.")
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx
index ad975d3f9ae7..8a2ae199c2fd 100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -344,9 +344,10 @@ handleAuthenticationRequest_(
{
uno::Sequence< OUString >
aPassList(aInfo.GetAccount().isEmpty() ? 1 : 2);
- aPassList[0] = aInfo.GetPassword();
+ auto pPassList = aPassList.getArray();
+ pPassList[0] = aInfo.GetPassword();
if (!aInfo.GetAccount().isEmpty())
- aPassList[1] = aInfo.GetAccount();
+ pPassList[1] = aInfo.GetAccount();
if (aInfo.GetIsRememberPassword())
{
@@ -436,8 +437,8 @@ executeMasterPasswordDialog(
OUStringBuffer aBuffer;
for (sal_uInt8 i : aKey)
{
- aBuffer.append(static_cast< sal_Unicode >('a' + (i >> 4)));
- aBuffer.append(static_cast< sal_Unicode >('a' + (i & 15)));
+ // match PasswordContainer::DecodePasswords aMasterPasswd.copy(index * 2, 2).toUInt32(16));
+ aBuffer.append(OUString::number(i >> 4, 16) + OUString::number(i & 15, 16));
}
rInfo.SetPassword(aBuffer.makeStringAndClear());
}
diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx
index c03d518108f3..e4be8a713911 100644
--- a/uui/source/iahndl-errorhandler.cxx
+++ b/uui/source/iahndl-errorhandler.cxx
@@ -33,6 +33,7 @@
#include <rtl/ustrbuf.hxx>
#include <ids.hrc>
+#include <strings.hrc>
#include "getcontinuations.hxx"
#include "iahndl.hxx"
@@ -74,26 +75,25 @@ executeErrorDialog(
{
case task::InteractionClassification_ERROR:
xBox.reset(Application::CreateMessageDialog(pParent,
- VclMessageType::Error, VclButtonsType::NONE, aText.makeStringAndClear()));
+ VclMessageType::Error, VclButtonsType::NONE, aText.makeStringAndClear(), GetpApp()));
break;
case task::InteractionClassification_WARNING:
xBox.reset(Application::CreateMessageDialog(pParent,
- VclMessageType::Warning, VclButtonsType::NONE, aText.makeStringAndClear()));
+ VclMessageType::Warning, VclButtonsType::NONE, aText.makeStringAndClear(), GetpApp()));
break;
case task::InteractionClassification_INFO:
xBox.reset(Application::CreateMessageDialog(pParent,
- VclMessageType::Info, VclButtonsType::NONE, aText.makeStringAndClear()));
+ VclMessageType::Info, VclButtonsType::NONE, aText.makeStringAndClear(), GetpApp()));
break;
case task::InteractionClassification_QUERY:
xBox.reset(Application::CreateMessageDialog(pParent,
- VclMessageType::Question, VclButtonsType::NONE, aText.makeStringAndClear()));
+ VclMessageType::Question, VclButtonsType::NONE, aText.makeStringAndClear(), GetpApp()));
break;
default:
assert(false);
break;
}
-
switch (nButtonMask)
{
case MessageBoxStyle::NONE:
@@ -290,4 +290,42 @@ UUIInteractionHelper::handleErrorHandlerRequest(
}
}
+void
+UUIInteractionHelper::handleLoadReadOnlyRequest(
+ const OUString& sDocumentURL,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations)
+{
+ std::locale aLocale(Translate::Create("uui"));
+ std::vector<OUString> aArguments = { sDocumentURL };
+ uno::Reference<task::XInteractionRetry> xRetry;
+ uno::Reference<task::XInteractionAbort> xAbort;
+ uno::Reference<task::XInteractionApprove> xApprove;
+ uno::Reference<task::XInteractionDisapprove> xDisapprove;
+ uno::Reference<awt::XWindow> xParent = getParentXWindow();
+ OUString aMessage(Translate::get(STR_LOADREADONLY_MSG, aLocale));
+
+ aMessage = replaceMessageWithArguments(aMessage, aArguments);
+ getContinuations(rContinuations, &xApprove, &xDisapprove, &xRetry, &xAbort);
+
+ std::unique_ptr<weld::MessageDialog> xBox(
+ Application::CreateMessageDialog(Application::GetFrameWeld(xParent),
+ VclMessageType::Question,
+ VclButtonsType::YesNo,
+ aMessage,
+ GetpApp()));
+
+ if (xBox->run() == RET_YES)
+ {
+ if (xApprove.is())
+ xApprove->select();
+ }
+ else
+ {
+ if (xDisapprove.is())
+ xDisapprove->select();
+ }
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx
index 47b15dc5e9da..b1f55dd85667 100644
--- a/uui/source/iahndl-locking.cxx
+++ b/uui/source/iahndl-locking.cxx
@@ -23,7 +23,6 @@
#include <com/sun/star/document/LockFileIgnoreRequest.hpp>
#include <com/sun/star/document/LockFileCorruptRequest.hpp>
#include <com/sun/star/document/OwnLockOnDocumentRequest.hpp>
-#include <com/sun/star/document/ReadOnlyOpenRequest.hpp>
#include <com/sun/star/document/ReloadEditableRequest.hpp>
#include <com/sun/star/task/XInteractionApprove.hpp>
#include <com/sun/star/task/XInteractionDisapprove.hpp>
@@ -43,7 +42,6 @@
#include "filechanged.hxx"
#include "lockfailed.hxx"
#include "lockcorrupt.hxx"
-#include "readonlyopen.hxx"
#include "reloadeditable.hxx"
#include "iahndl.hxx"
@@ -57,35 +55,6 @@ using namespace com::sun::star;
namespace {
-void handleReadOnlyOpenRequest_(
- weld::Window* pParent, const OUString& aDocumentURL,
- uno::Sequence<uno::Reference<task::XInteractionContinuation>> const& rContinuations)
-{
- uno::Reference<task::XInteractionApprove> xApprove;
- uno::Reference<task::XInteractionAbort> xAbort;
- getContinuations(rContinuations, &xApprove, &xAbort);
-
- if (!xApprove.is() || !xAbort.is())
- return;
-
- SolarMutexGuard aGuard;
- std::locale aResLocale = Translate::Create("uui");
-
- OUString aMessage;
- std::vector<OUString> aArguments { aDocumentURL };
-
- aMessage = Translate::get(STR_READONLYOPEN_MSG, aResLocale);
- aMessage = UUIInteractionHelper::replaceMessageWithArguments(aMessage, aArguments);
-
- ReadOnlyOpenQueryBox aDialog(pParent, aResLocale, aMessage);
- int nResult = aDialog.run();
-
- if (nResult == RET_YES)
- xApprove->select();
- else if (nResult != RET_RETRY)
- xAbort->select();
-}
-
void handleReloadEditableRequest_(
weld::Window* pParent, const OUString& aDocumentURL,
uno::Sequence<uno::Reference<task::XInteractionContinuation>> const& rContinuations)
@@ -138,6 +107,7 @@ handleLockedDocumentRequest_(
std::locale aResLocale = Translate::Create("uui");
OUString aMessage;
+ OUString aHiddenData;
std::vector< OUString > aArguments { aDocumentURL };
bool bAllowOverride = xRetry.is() && officecfg::Office::Common::Misc::AllowOverrideLocking::get();
@@ -148,14 +118,12 @@ handleLockedDocumentRequest_(
aArguments.push_back( !aInfo.isEmpty()
? aInfo
: Translate::get( STR_UNKNOWNUSER, aResLocale) );
- aArguments.push_back( bAllowOverride
- ? Translate::get( STR_OPENLOCKED_ALLOWIGNORE_MSG, aResLocale )
- : "" );
- aMessage = Translate::get(STR_OPENLOCKED_MSG, aResLocale);
- aMessage = UUIInteractionHelper::replaceMessageWithArguments(
- aMessage, aArguments );
- OpenLockedQueryBox aDialog(pParent, aResLocale, aMessage, bAllowOverride);
+ aHiddenData = Translate::get(STR_OPENLOCKED_HIDDEN_DATA, aResLocale);
+ aHiddenData = UUIInteractionHelper::replaceMessageWithArguments(
+ aHiddenData, aArguments );
+
+ vcl::OpenLockedQueryBox aDialog(pParent, aHiddenData, bAllowOverride);
nResult = aDialog.run();
}
else if ( nMode == UUI_DOC_SAVE_LOCK )
@@ -168,7 +136,7 @@ handleLockedDocumentRequest_(
aResLocale);
aMessage = UUIInteractionHelper::replaceMessageWithArguments(
aMessage, aArguments );
-
+
TryLaterQueryBox aDialog(pParent, aResLocale, aMessage, bAllowOverride);
nResult = aDialog.run();
}
@@ -354,24 +322,6 @@ UUIInteractionHelper::handleLockFileProblemRequest(
return false;
}
-bool UUIInteractionHelper::handleReadOnlyOpenRequest(
- uno::Reference<task::XInteractionRequest> const& rRequest)
-{
- uno::Any aAnyRequest(rRequest->getRequest());
-
- document::ReadOnlyOpenRequest aReadOnlyOpenRequest;
- if (aAnyRequest >>= aReadOnlyOpenRequest)
- {
- uno::Reference<awt::XWindow> xParent = getParentXWindow();
- handleReadOnlyOpenRequest_(Application::GetFrameWeld(xParent),
- aReadOnlyOpenRequest.DocumentURL,
- rRequest->getContinuations());
- return true;
- }
-
- return false;
-}
-
bool UUIInteractionHelper::handleReloadEditableRequest(
uno::Reference<task::XInteractionRequest> const& rRequest)
{
diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx
index bf4e8811f949..3e2525093935 100644
--- a/uui/source/iahndl-ssl.cxx
+++ b/uui/source/iahndl-ssl.cxx
@@ -31,6 +31,7 @@
#include <comphelper/lok.hxx>
#include <comphelper/sequence.hxx>
#include <com/sun/star/uno/Sequence.hxx>
+#include <o3tl/string_view.hxx>
#include <svl/numformat.hxx>
#include <svl/zforlist.hxx>
#include <unotools/resmgr.hxx>
@@ -54,7 +55,7 @@ using namespace com::sun::star;
namespace {
OUString
-getContentPart( const OUString& _rRawString )
+getContentPart( std::u16string_view _rRawString )
{
// search over some parts to find a string
static char const * aIDs[] = { "CN=", "OU=", "O=", "E=", nullptr };
@@ -63,15 +64,15 @@ getContentPart( const OUString& _rRawString )
while ( aIDs[i] )
{
OUString sPartId = OUString::createFromAscii( aIDs[i++] );
- sal_Int32 nContStart = _rRawString.indexOf( sPartId );
- if ( nContStart != -1 )
+ size_t nContStart = _rRawString.find( sPartId );
+ if ( nContStart != std::u16string_view::npos )
{
nContStart += sPartId.getLength();
- sal_Int32 nContEnd = _rRawString.indexOf( ',', nContStart );
- if ( nContEnd != -1 )
- sPart = _rRawString.copy( nContStart, nContEnd - nContStart );
+ size_t nContEnd = _rRawString.find( ',', nContStart );
+ if ( nContEnd != std::u16string_view::npos )
+ sPart = _rRawString.substr( nContStart, nContEnd - nContStart );
else
- sPart = _rRawString.copy( nContStart );
+ sPart = _rRawString.substr( nContStart );
break;
}
}
@@ -80,21 +81,21 @@ getContentPart( const OUString& _rRawString )
bool
isDomainMatch(
- const OUString& hostName, const uno::Sequence< OUString >& certHostNames)
+ std::u16string_view hostName, const uno::Sequence< OUString >& certHostNames)
{
for ( const OUString& element : certHostNames){
if (element.isEmpty())
continue;
- if (hostName.equalsIgnoreAsciiCase( element ))
+ if (o3tl::equalsIgnoreAsciiCase( hostName, element ))
return true;
if (element.startsWith("*") &&
- hostName.getLength() >= element.getLength() )
+ sal_Int32(hostName.size()) >= element.getLength() )
{
OUString cmpStr = element.copy( 1 );
- if ( hostName.matchIgnoreAsciiCase(
- cmpStr, hostName.getLength() - cmpStr.getLength()) )
+ if ( o3tl::matchIgnoreAsciiCase(hostName,
+ cmpStr, hostName.size() - cmpStr.getLength()) )
return true;
}
}
@@ -272,16 +273,15 @@ handleCertificateValidationRequest_(
altNames = comphelper::sequenceToContainer<std::vector<security::CertAltNameEntry>>(sanExtension->getAlternativeNames());
}
- OUString certHostName = getContentPart( rRequest.Certificate->getSubjectName() );
uno::Sequence< OUString > certHostNames(altNames.size() + 1);
-
- certHostNames[0] = certHostName;
+ auto pcertHostNames = certHostNames.getArray();
+ pcertHostNames[0] = getContentPart(rRequest.Certificate->getSubjectName());
for (size_t n = 0; n < altNames.size(); ++n)
{
if (altNames[n].Type == security::ExtAltNameType_DNS_NAME)
{
- altNames[n].Value >>= certHostNames[n+1];
+ altNames[n].Value >>= pcertHostNames[n+1];
}
}
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index e36598605b8f..291d3f18e844 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -32,7 +32,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/script/ModuleSizeExceededRequest.hpp>
#include <com/sun/star/task/ErrorCodeIOException.hpp>
-#include <com/sun/star/task/ErrorCodeRequest.hpp>
+#include <com/sun/star/task/ErrorCodeRequest2.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/task/XInteractionApprove.hpp>
@@ -62,10 +62,11 @@
#include <rtl/ustrbuf.hxx>
#include <osl/conditn.hxx>
#include <unotools/resmgr.hxx>
+#include <utility>
#include <vcl/errinf.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <comphelper/documentconstants.hxx>
#include <comphelper/propertysequence.hxx>
#include <svtools/sfxecode.hxx>
@@ -83,6 +84,7 @@
#include "iahndl.hxx"
#include "nameclashdlg.hxx"
+#include <comphelper/string.hxx>
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::UNO_QUERY;
@@ -108,8 +110,8 @@ class HandleData : public osl::Condition
{
public:
explicit HandleData(
- uno::Reference< task::XInteractionRequest > const & rRequest)
- : m_rRequest(rRequest),
+ uno::Reference< task::XInteractionRequest > xRequest)
+ : m_rRequest(std::move(xRequest)),
bHandled( false )
{
}
@@ -121,18 +123,8 @@ public:
} /* namespace */
UUIInteractionHelper::UUIInteractionHelper(
- uno::Reference< uno::XComponentContext > const & rxContext,
- uno::Reference< awt::XWindow > const & rxWindowParam,
- const OUString & rContextParam)
- : m_xContext(rxContext),
- m_xWindowParam(rxWindowParam),
- m_aContextParam(rContextParam)
-{
-}
-
-UUIInteractionHelper::UUIInteractionHelper(
- uno::Reference< uno::XComponentContext > const & rxContext)
- : m_xContext(rxContext)
+ uno::Reference< uno::XComponentContext > xContext)
+ : m_xContext(std::move(xContext))
{
}
@@ -149,9 +141,16 @@ void UUIInteractionHelper::handlerequest(
= static_cast< UUIInteractionHelper * >(pInteractionHelper);
bool bDummy = false;
OUString aDummy;
- pHND->bHandled
- = pUUI->handleRequest_impl(pHND->m_rRequest, false, bDummy, aDummy);
- pHND->set();
+ try
+ {
+ pHND->bHandled
+ = pUUI->handleRequest_impl(pHND->m_rRequest, false, bDummy, aDummy);
+ pHND->set();
+ }
+ catch (css::uno::Exception&)
+ {
+ TOOLS_WARN_EXCEPTION("uui", "");
+ }
}
bool
@@ -265,17 +264,6 @@ UUIInteractionHelper::isInformationalErrorMessageRequest(
return xAbort.is();
}
-bool
-UUIInteractionHelper::tryOtherInteractionHandler(
- uno::Reference< task::XInteractionRequest > const & rRequest)
-{
- InteractionHandlerDataList dataList;
- getInteractionHandlerList(dataList);
-
- return std::any_of(dataList.cbegin(), dataList.cend(),
- [&](const InteractionHandlerData& rData) { return handleCustomRequest( rRequest, rData.ServiceName ); });
-}
-
namespace
{
@@ -391,19 +379,8 @@ UUIInteractionHelper::handleRequest_impl(
if (aAnyRequest >>= aModSizeException )
{
std::vector< OUString > aArguments;
- uno::Sequence< OUString > sModules
- = aModSizeException.Names;
- if ( sModules.hasElements() )
- {
- OUStringBuffer aName;
- for ( sal_Int32 index=0; index< sModules.getLength(); ++index )
- {
- if ( index )
- aName.append(",");
- aName.append(sModules[index]);
- }
- aArguments.push_back( aName.makeStringAndClear() );
- }
+ aArguments.push_back(
+ comphelper::string::convertCommaSeparated(aModSizeException.Names));
handleErrorHandlerRequest( task::InteractionClassification_WARNING,
ERRCODE_UUI_IO_MODULESIZEEXCEEDED,
aArguments,
@@ -722,6 +699,17 @@ UUIInteractionHelper::handleRequest_impl(
return true;
}
+ task::ErrorCodeRequest2 aErrorCodeRequest2;
+ if (aAnyRequest >>= aErrorCodeRequest2)
+ {
+ handleGenericErrorRequest(
+ ErrCodeMsg(ErrCode(aErrorCodeRequest2.ErrCode), aErrorCodeRequest2.Arg1, aErrorCodeRequest2.Arg2, static_cast<DialogMask>(aErrorCodeRequest2.DialogMask)),
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
+ }
task::ErrorCodeRequest aErrorCodeRequest;
if (aAnyRequest >>= aErrorCodeRequest)
{
@@ -810,9 +798,6 @@ UUIInteractionHelper::handleRequest_impl(
if ( handleReloadEditableRequest( rRequest ) )
return true;
- if ( handleReadOnlyOpenRequest( rRequest ) )
- return true;
-
task::DocumentMacroConfirmationRequest aMacroConfirmRequest;
if (aAnyRequest >>= aMacroConfirmRequest)
{
@@ -825,16 +810,23 @@ UUIInteractionHelper::handleRequest_impl(
return true;
}
+ OUString aFileName;
+ beans::NamedValue aLoadReadOnlyRequest;
+ if ((aAnyRequest >>= aLoadReadOnlyRequest) &&
+ aLoadReadOnlyRequest.Name == "LoadReadOnlyRequest" &&
+ (aLoadReadOnlyRequest.Value >>= aFileName))
+ {
+ handleLoadReadOnlyRequest(aFileName,
+ rRequest->getContinuations());
+ return true;
+ }
+
// Last chance: interaction handlers registered in the configuration
// typed InteractionHandlers (ooo.Interactions)
if ( handleTypedHandlerImplementations( rRequest ) )
return true;
-
- // legacy configuration (ooo.ucb.InteractionHandlers)
- if (tryOtherInteractionHandler( rRequest ))
- return true;
}
// Not handled.
@@ -851,80 +843,6 @@ UUIInteractionHelper::handleRequest_impl(
return false;
}
-void
-UUIInteractionHelper::getInteractionHandlerList(
- InteractionHandlerDataList &rdataList)
-{
- try
- {
- uno::Reference< lang::XMultiServiceFactory > xConfigProv =
- configuration::theDefaultProvider::get( m_xContext );
-
- uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence(
- {
- {"nodepath", uno::Any(OUString("/org.openoffice.ucb.InteractionHandler/InteractionHandlers"))}
- }));
-
- uno::Reference< uno::XInterface > xInterface(
- xConfigProv->createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess" , aArguments ) );
-
- if ( !xInterface.is() )
- throw uno::RuntimeException("unable to instantiate config access");
-
- uno::Reference< container::XNameAccess > xNameAccess(
- xInterface, uno::UNO_QUERY_THROW );
- const uno::Sequence< OUString > aElems = xNameAccess->getElementNames();
-
- if ( aElems.hasElements() )
- {
- uno::Reference< container::XHierarchicalNameAccess >
- xHierNameAccess( xInterface, uno::UNO_QUERY_THROW );
-
- // Iterate over children.
- for ( const auto& rElem : aElems )
- {
- try
- {
- InteractionHandlerData aInfo;
-
- // Obtain service name.
- OUString aKeyBuffer = "['" + rElem + "']/ServiceName";
-
- OUString aValue;
- if ( !( xHierNameAccess->getByHierarchicalName(
- aKeyBuffer ) >>= aValue ) )
- {
- OSL_FAIL( "GetInteractionHandlerList - "
- "Error getting item value!" );
- continue;
- }
-
- aInfo.ServiceName = aValue;
-
- // Append info to list.
- rdataList.push_back( aInfo );
- }
- catch ( container::NoSuchElementException& )
- {
- // getByHierarchicalName
-
- OSL_FAIL( "GetInteractionHandlerList - "
- "caught NoSuchElementException!" );
- }
- }
- }
- }
- catch ( uno::RuntimeException const & )
- {
- throw;
- }
- catch ( uno::Exception const & )
- {
- TOOLS_WARN_EXCEPTION( "uui", "GetInteractionHandlerList" );
- }
-}
-
const uno::Reference< awt::XWindow>&
UUIInteractionHelper::getParentXWindow() const
{
@@ -951,7 +869,7 @@ executeMessageBox(
SolarMutexGuard aGuard;
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, eMessageType,
- eMessageType == VclMessageType::Question ? VclButtonsType::YesNo : VclButtonsType::Ok, rMessage));
+ eMessageType == VclMessageType::Question ? VclButtonsType::YesNo : VclButtonsType::Ok, rMessage, GetpApp()));
xBox->set_title(rTitle);
short nMessResult = xBox->run();
@@ -971,6 +889,7 @@ executeMessageBox(
aResult = DialogMask::ButtonsNo;
break;
default:
+ SAL_WARN("uui", "executeMessageBox: nMessResult is " << nMessResult);
assert(false);
}
@@ -1051,7 +970,7 @@ UUIInteractionHelper::handleNameClashResolveRequest(
void
UUIInteractionHelper::handleGenericErrorRequest(
- ErrCode nErrorCode,
+ ErrCodeMsg nErrorCode,
uno::Sequence< uno::Reference<
task::XInteractionContinuation > > const & rContinuations,
bool bObtainErrorStringOnly,
@@ -1077,10 +996,9 @@ UUIInteractionHelper::handleGenericErrorRequest(
// Note: It's important to convert the transported long to the
// required unsigned long value. Otherwise using as flag field
// can fail ...
- ErrCode nError(nErrorCode);
- bool bWarning = !nError.IgnoreWarning();
+ bool bWarning = !nErrorCode.IgnoreWarning();
- if ( nError == ERRCODE_SFX_INCOMPLETE_ENCRYPTION )
+ if ( nErrorCode == ERRCODE_SFX_INCOMPLETE_ENCRYPTION )
{
// the security warning box needs a special title
OUString aErrorString;
@@ -1240,7 +1158,7 @@ bool ErrorResource::getString(ErrCode nErrorCode, OUString &rString) const
{
for (const std::pair<TranslateId, ErrCode>* pStringArray = m_pStringArray; pStringArray->first; ++pStringArray)
{
- if (nErrorCode.StripWarningAndDynamic() == pStringArray->second.StripWarningAndDynamic())
+ if (nErrorCode.StripWarning() == pStringArray->second.StripWarning())
{
rString = Translate::get(pStringArray->first, m_rResLocale);
return true;
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index 790686432cef..d9a31ec77723 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -28,7 +28,7 @@
#include <com/sun/star/beans/Optional.hpp>
#include <com/sun/star/task/InteractionClassification.hpp>
-#include <vcl/errcode.hxx>
+#include <comphelper/errcode.hxx>
#include <unotools/resmgr.hxx>
#include <unordered_map>
@@ -57,15 +57,6 @@ namespace com::sun::star {
}
}
-struct InteractionHandlerData
-{
- /** The UNO service name to use to instantiate the content provider.
- */
- OUString ServiceName;
-};
-
-typedef std::vector< InteractionHandlerData > InteractionHandlerDataList;
-
typedef std::unordered_map< OUString, OUString > StringHashMap;
class UUIInteractionHelper
@@ -73,22 +64,20 @@ class UUIInteractionHelper
private:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
css::uno::Reference< css::awt::XWindow > m_xWindowParam;
- const OUString m_aContextParam;
+ OUString m_aContextParam;
StringHashMap m_aTypedCustomHandlers;
UUIInteractionHelper(UUIInteractionHelper const &) = delete;
UUIInteractionHelper& operator =(UUIInteractionHelper const &) = delete;
public:
- UUIInteractionHelper(
- css::uno::Reference< css::uno::XComponentContext > const & rxContext,
- css::uno::Reference< css::awt::XWindow > const & rxWindow,
- const OUString & rContextParam);
explicit UUIInteractionHelper(
- css::uno::Reference< css::uno::XComponentContext > const & rxContext);
+ css::uno::Reference< css::uno::XComponentContext > xContext);
const css::uno::Reference<css::awt::XWindow> & GetParentWindow() const { return m_xWindowParam; }
void SetParentWindow(const css::uno::Reference<css::awt::XWindow>& rWindow) { m_xWindowParam = rWindow; }
+ void setContext(OUString const & context) { m_aContextParam = context; }
+
~UUIInteractionHelper();
bool handleRequest( css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
@@ -103,9 +92,6 @@ public:
const OUString& aMessage,
std::vector< OUString > const & rArguments );
- const css::uno::Reference< css::uno::XComponentContext >&
- getORB() const
- { return m_xContext; }
private:
bool
handleRequest_impl(
@@ -132,13 +118,6 @@ private:
css::uno::Reference< css::task::XInteractionRequest > const & rRequest
);
- bool
- tryOtherInteractionHandler(
- css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
-
- void
- getInteractionHandlerList(InteractionHandlerDataList &rdataList);
-
static bool
isInformationalErrorMessageRequest(
css::uno::Sequence<
@@ -195,7 +174,7 @@ private:
void
handleGenericErrorRequest(
- ErrCode nErrorCode,
+ ErrCodeMsg nErrorCode,
css::uno::Sequence<
css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations,
bool bObtainErrorStringOnly,
@@ -233,9 +212,6 @@ private:
bool handleReloadEditableRequest(
css::uno::Reference<css::task::XInteractionRequest> const& rRequest);
- bool
- handleReadOnlyOpenRequest(css::uno::Reference<css::task::XInteractionRequest> const& rRequest);
-
bool handleCustomRequest(
const css::uno::Reference< css::task::XInteractionRequest >& i_rRequest,
const OUString& i_rServiceName
@@ -246,6 +222,11 @@ private:
const OUString & instructions,
const OUString & url,
css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations );
+
+ void
+ handleLoadReadOnlyRequest(
+ const OUString& sDocumentURL,
+ css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations);
};
class ErrorResource
diff --git a/uui/source/interactionhandler.cxx b/uui/source/interactionhandler.cxx
index cc5579fd1ed1..ea6ebf6d36a4 100644
--- a/uui/source/interactionhandler.cxx
+++ b/uui/source/interactionhandler.cxx
@@ -46,7 +46,7 @@ class UUIInteractionHandler:
css::beans::XPropertySet>
{
private:
- std::unique_ptr<UUIInteractionHelper> m_pImpl;
+ UUIInteractionHelper m_pImpl;
public:
explicit UUIInteractionHandler(css::uno::Reference< css::uno::XComponentContext > const & rxContext);
@@ -113,7 +113,7 @@ public:
{
css::uno::Reference<css::awt::XWindow> xWindow;
rValue >>= xWindow;
- m_pImpl->SetParentWindow(xWindow);
+ m_pImpl.SetParentWindow(xWindow);
return;
}
throw css::beans::UnknownPropertyException(rPropertyName);
@@ -123,7 +123,7 @@ public:
{
if (rPropertyName == "ParentWindow")
{
- return uno::Any(m_pImpl->GetParentWindow());
+ return uno::Any(m_pImpl.GetParentWindow());
}
throw css::beans::UnknownPropertyException(rPropertyName);
}
@@ -131,7 +131,7 @@ public:
UUIInteractionHandler::UUIInteractionHandler(
uno::Reference< uno::XComponentContext > const & rxContext)
- : m_pImpl(new UUIInteractionHelper(rxContext))
+ : m_pImpl(rxContext)
{
}
@@ -160,9 +160,6 @@ void SAL_CALL
UUIInteractionHandler::initialize(
uno::Sequence< uno::Any > const & rArguments)
{
- uno::Reference<uno::XComponentContext> xContext = m_pImpl->getORB();
- m_pImpl.reset();
-
// The old-style InteractionHandler service supported a sequence of
// PropertyValue, while the new-style service now uses constructors to pass
// in Parent and Context values; for backwards compatibility, keep support
@@ -184,7 +181,8 @@ UUIInteractionHandler::initialize(
}
}
- m_pImpl.reset( new UUIInteractionHelper(xContext, xWindow, aContext) );
+ m_pImpl.SetParentWindow(xWindow);
+ m_pImpl.setContext(aContext);
}
void SAL_CALL
@@ -193,7 +191,7 @@ UUIInteractionHandler::handle(
{
try
{
- m_pImpl->handleRequest(rRequest);
+ m_pImpl.handleRequest(rRequest);
}
catch (uno::RuntimeException const & ex)
{
@@ -208,7 +206,7 @@ sal_Bool SAL_CALL UUIInteractionHandler::handleInteractionRequest(
{
try
{
- return m_pImpl->handleRequest( Request );
+ return m_pImpl.handleRequest( Request );
}
catch (uno::RuntimeException const & ex)
{
diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx
index 11c6b20394bd..8232620decbb 100644
--- a/uui/source/logindlg.cxx
+++ b/uui/source/logindlg.cxx
@@ -18,6 +18,7 @@
*/
#include <comphelper/string.hxx>
+#include <utility>
#include "logindlg.hxx"
#ifdef UNX
@@ -84,13 +85,13 @@ void LoginDialog::SetRequest()
OUString aRequest;
if (m_xAccountFT->get_visible() && !m_realm.isEmpty())
{
- std::unique_ptr<weld::Label> xText(m_xBuilder->weld_label(oldPwd ? "wrongloginrealm" : "loginrealm"));
+ std::unique_ptr<weld::Label> xText(m_xBuilder->weld_label(oldPwd ? OUString("wrongloginrealm") : OUString("loginrealm")));
aRequest = xText->get_label();
aRequest = aRequest.replaceAll("%2", m_realm);
}
else
{
- std::unique_ptr<weld::Label> xText(m_xBuilder->weld_label(oldPwd ? "wrongrequestinfo" : "requestinfo"));
+ std::unique_ptr<weld::Label> xText(m_xBuilder->weld_label(oldPwd ? OUString("wrongrequestinfo") : OUString("requestinfo")));
aRequest = xText->get_label();
}
aRequest = aRequest.replaceAll("%1", m_server);
@@ -111,7 +112,7 @@ IMPL_LINK_NOARG(LoginDialog, UseSysCredsHdl_Impl, weld::Toggleable&, void)
}
LoginDialog::LoginDialog(weld::Window* pParent, LoginFlags nFlags,
- const OUString& rServer, const OUString& rRealm)
+ OUString aServer, OUString aRealm)
: GenericDialogController(pParent, "uui/ui/logindialog.ui", "LoginDialog")
, m_xErrorFT(m_xBuilder->weld_label("errorft"))
, m_xErrorInfo(m_xBuilder->weld_label("errorinfo"))
@@ -125,7 +126,7 @@ LoginDialog::LoginDialog(weld::Window* pParent, LoginFlags nFlags,
, m_xSavePasswdBtn(m_xBuilder->weld_check_button("remember"))
, m_xUseSysCredsCB(m_xBuilder->weld_check_button("syscreds"))
, m_xOKBtn(m_xBuilder->weld_button("ok"))
- , m_server(rServer), m_realm(rRealm)
+ , m_server(std::move(aServer)), m_realm(std::move(aRealm))
{
if ( !( nFlags & LoginFlags::NoUseSysCreds ) )
EnableUseSysCredsControls_Impl( m_xUseSysCredsCB->get_active() );
diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx
index 82bc18544842..4dfe8fc962b8 100644
--- a/uui/source/logindlg.hxx
+++ b/uui/source/logindlg.hxx
@@ -62,7 +62,7 @@ class LoginDialog : public weld::GenericDialogController
public:
LoginDialog(weld::Window* pParent, LoginFlags nFlags,
- const OUString& rServer, const OUString &rRealm);
+ OUString aServer, OUString aRealm);
virtual ~LoginDialog() override;
OUString GetName() const { return m_xNameED->get_text(); }
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index 4801bec28f85..f0c456365646 100644
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
@@ -17,10 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <officecfg/Office/Common.hxx>
#include <unotools/resmgr.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <strings.hrc>
+#include <svl/PasswordHelper.hxx>
#include "masterpasscrtdlg.hxx"
// MasterPasswordCreateDialog---------------------------------------------------
@@ -28,11 +30,31 @@
IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl, weld::Entry&, void)
{
- m_xOKBtn->set_sensitive(m_xEDMasterPasswordCrt->get_text().getLength() >= 1);
+ OUString aPasswordText = m_xEDMasterPasswordCrt->get_text();
+ m_xOKBtn->set_sensitive(aPasswordText.getLength() >= 1);
+ m_xPasswdStrengthBar->set_percentage(
+ SvPasswordHelper::GetPasswordStrengthPercentage(aPasswordText));
+
+ if(m_oPasswordPolicy)
+ {
+ bool bPasswordMeetsPolicy
+ = SvPasswordHelper::PasswordMeetsPolicy(aPasswordText, m_oPasswordPolicy);
+ m_xEDMasterPasswordCrt->set_message_type(bPasswordMeetsPolicy ? weld::EntryMessageType::Normal
+ : weld::EntryMessageType::Error);
+ m_xPasswordPolicyLabel->set_visible(!bPasswordMeetsPolicy);
+ }
}
IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl, weld::Button&, void)
{
+ if (m_oPasswordPolicy
+ && !SvPasswordHelper::PasswordMeetsPolicy(m_xEDMasterPasswordCrt->get_text(),
+ m_oPasswordPolicy))
+ {
+ m_xEDMasterPasswordCrt->grab_focus();
+ return;
+ }
+
// compare both passwords and show message box if there are not equal!!
if (m_xEDMasterPasswordCrt->get_text() == m_xEDMasterPasswordRepeat->get_text())
m_xDialog->response(RET_OK);
@@ -53,12 +75,20 @@ MasterPasswordCreateDialog::MasterPasswordCreateDialog(weld::Window* pParent, co
: GenericDialogController(pParent, "uui/ui/setmasterpassworddlg.ui", "SetMasterPasswordDialog")
, rResLocale(rLocale)
, m_xEDMasterPasswordCrt(m_xBuilder->weld_entry("password1"))
+ , m_xPasswordPolicyLabel(m_xBuilder->weld_label("passpolicylabel"))
, m_xEDMasterPasswordRepeat(m_xBuilder->weld_entry("password2"))
, m_xOKBtn(m_xBuilder->weld_button("ok"))
+ , m_xPasswdStrengthBar(m_xBuilder->weld_level_bar("password1levelbar"))
+ , m_oPasswordPolicy(officecfg::Office::Common::Security::Scripting::PasswordPolicy::get())
{
m_xOKBtn->set_sensitive(false);
m_xOKBtn->connect_clicked( LINK( this, MasterPasswordCreateDialog, OKHdl_Impl ) );
m_xEDMasterPasswordCrt->connect_changed( LINK( this, MasterPasswordCreateDialog, EditHdl_Impl ) );
+ if (m_oPasswordPolicy)
+ {
+ m_xPasswordPolicyLabel->set_label(
+ officecfg::Office::Common::Security::Scripting::PasswordPolicyErrorMessage::get());
+ }
}
MasterPasswordCreateDialog::~MasterPasswordCreateDialog()
diff --git a/uui/source/masterpasscrtdlg.hxx b/uui/source/masterpasscrtdlg.hxx
index a8695fc1ed27..83f981190bb1 100644
--- a/uui/source/masterpasscrtdlg.hxx
+++ b/uui/source/masterpasscrtdlg.hxx
@@ -27,8 +27,11 @@ private:
const std::locale& rResLocale;
std::unique_ptr<weld::Entry> m_xEDMasterPasswordCrt;
+ std::unique_ptr<weld::Label> m_xPasswordPolicyLabel;
std::unique_ptr<weld::Entry> m_xEDMasterPasswordRepeat;
std::unique_ptr<weld::Button> m_xOKBtn;
+ std::unique_ptr<weld::LevelBar> m_xPasswdStrengthBar;
+ std::optional<OUString> m_oPasswordPolicy;
DECL_LINK(OKHdl_Impl, weld::Button&, void);
DECL_LINK(EditHdl_Impl, weld::Entry&, void);
diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx
index a0284b194b14..adcf060a2274 100644
--- a/uui/source/openlocked.cxx
+++ b/uui/source/openlocked.cxx
@@ -20,23 +20,57 @@
#include <strings.hrc>
#include "openlocked.hxx"
#include <officecfg/Office/Common.hxx>
-#include <unotools/resmgr.hxx>
-#include <vcl/stdtext.hxx>
-#include <vcl/svapp.hxx>
+#include <vcl/weldutils.hxx>
-OpenLockedQueryBox::OpenLockedQueryBox(weld::Window* pParent, const std::locale& rResLocale, const OUString& rMessage, bool bEnableOverride)
- : m_xQueryBox(Application::CreateMessageDialog(pParent, VclMessageType::Question, VclButtonsType::NONE, rMessage))
+using namespace vcl;
+
+IMPL_LINK(OpenLockedQueryBox, ClickHdl, weld::Button&, rButton, void)
+{
+ if (&rButton == mxOpenReadOnlyBtn.get())
+ {
+ if (mxNotifyBtn->get_active())
+ m_xDialog->response(RET_RETRY);
+ else
+ m_xDialog->response(RET_YES);
+ }
+ else if (&rButton == mxOpenCopyBtn.get())
+ {
+ m_xDialog->response(RET_NO);
+ }
+ else if (&rButton == mxOpenBtn.get())
+ {
+ m_xDialog->response(RET_IGNORE);
+ }
+ else if (&rButton == mxCancelBtn.get())
+ {
+ m_xDialog->response(RET_CANCEL);
+ }
+}
+
+OpenLockedQueryBox::OpenLockedQueryBox(weld::Window* pParent, const OUString& rHiddenData, bool bEnableOverride)
+ : GenericDialogController(pParent, "vcl/ui/openlockedquerybox.ui", "OpenLockedQueryBox")
+ , mxQuestionMarkImage(m_xBuilder->weld_image("questionmark"))
+ , mxOpenReadOnlyBtn(m_xBuilder->weld_button("readonly"))
+ , mxOpenCopyBtn(m_xBuilder->weld_button("opencopy"))
+ , mxOpenBtn(m_xBuilder->weld_button("open"))
+ , mxCancelBtn(m_xBuilder->weld_button("cancel"))
+ , mxNotifyBtn(m_xBuilder->weld_check_button("notify"))
+ , mxHiddenText(m_xBuilder->weld_label("hiddentext"))
{
- m_xQueryBox->set_title(Translate::get(STR_OPENLOCKED_TITLE, rResLocale));
- m_xQueryBox->add_button(Translate::get(STR_OPENLOCKED_OPENREADONLY_BTN, rResLocale), RET_YES);
- m_xQueryBox->add_button(Translate::get(STR_OPENLOCKED_OPENREADONLY_NOTIFY_BTN, rResLocale), RET_RETRY);
- m_xQueryBox->add_button(Translate::get(STR_OPENLOCKED_OPENCOPY_BTN, rResLocale), RET_NO);
- if (bEnableOverride && officecfg::Office::Common::Misc::AllowOverrideLocking::get())
+ //setup click hdl
+ mxOpenReadOnlyBtn->connect_clicked(LINK(this, OpenLockedQueryBox, ClickHdl));
+ mxOpenCopyBtn->connect_clicked(LINK(this, OpenLockedQueryBox, ClickHdl));
+ mxOpenBtn->connect_clicked(LINK(this, OpenLockedQueryBox, ClickHdl));
+ mxCancelBtn->connect_clicked(LINK(this, OpenLockedQueryBox, ClickHdl));
+
+ if (!(bEnableOverride && officecfg::Office::Common::Misc::AllowOverrideLocking::get()))
{
- // Present option to ignore the (stale?) lock file and open the document
- m_xQueryBox->add_button(Translate::get(STR_ALREADYOPEN_OPEN_BTN, rResLocale), RET_IGNORE);
+ //disable option to ignore the (stale?) lock file and open the document
+ mxOpenBtn->set_sensitive(false);
}
- m_xQueryBox->add_button(GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
+
+ mxHiddenText->set_label(rHiddenData);
+ m_xDialog->set_centered_on_parent(true);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/openlocked.hxx b/uui/source/openlocked.hxx
index 178269a62b35..bd09f12d704f 100644
--- a/uui/source/openlocked.hxx
+++ b/uui/source/openlocked.hxx
@@ -20,15 +20,31 @@
#include <vcl/weld.hxx>
-class OpenLockedQueryBox
+namespace vcl
{
-private:
- std::unique_ptr<weld::MessageDialog> m_xQueryBox;
+class OpenLockedQueryBox;
+}
+namespace vcl
+{
+class OpenLockedQueryBox final : public weld::GenericDialogController
+{
public:
- OpenLockedQueryBox(weld::Window* pParent, const std::locale& rResLocale,
- const OUString& rMessage, bool bEnableOverride);
- short run() { return m_xQueryBox->run(); }
-};
+ OpenLockedQueryBox(weld::Window* pParent, const OUString& rHiddenData, bool bEnableOverride);
+
+private:
+ std::unique_ptr<weld::Image> mxQuestionMarkImage;
+
+ std::unique_ptr<weld::Button> mxOpenReadOnlyBtn;
+ std::unique_ptr<weld::Button> mxOpenCopyBtn;
+ std::unique_ptr<weld::Button> mxOpenBtn;
+ std::unique_ptr<weld::Button> mxCancelBtn;
+
+ std::unique_ptr<weld::CheckButton> mxNotifyBtn;
+ std::unique_ptr<weld::Label> mxHiddenText;
+
+ DECL_LINK(ClickHdl, weld::Button&, void);
+};
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx
index 2e2d0b0ac3cb..80ad1495a72d 100644
--- a/uui/source/passwordcontainer.cxx
+++ b/uui/source/passwordcontainer.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <comphelper/processfactory.hxx>
-#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/diagnose.h>
diff --git a/uui/source/passwordcontainer.hxx b/uui/source/passwordcontainer.hxx
index a18951161a80..e111dcb34fc7 100644
--- a/uui/source/passwordcontainer.hxx
+++ b/uui/source/passwordcontainer.hxx
@@ -22,7 +22,6 @@
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/task/XInteractionHandler2.hpp>
#include <com/sun/star/task/XPasswordContainer2.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -30,9 +29,6 @@
namespace com {
namespace sun {
namespace star {
- namespace lang {
- class XMultiServiceFactory;
- }
namespace ucb {
class AuthenticationRequest;
class XInteractionSupplyAuthentication;
diff --git a/uui/source/readonlyopen.cxx b/uui/source/readonlyopen.cxx
deleted file mode 100644
index 72a3b989e079..000000000000
--- a/uui/source/readonlyopen.cxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <strings.hrc>
-#include "readonlyopen.hxx"
-#include <officecfg/Office/Common.hxx>
-#include <unotools/resmgr.hxx>
-#include <vcl/stdtext.hxx>
-#include <vcl/svapp.hxx>
-
-ReadOnlyOpenQueryBox::ReadOnlyOpenQueryBox(weld::Window* pParent, const std::locale& rResLocale,
- const OUString& rMessage)
- : m_xQueryBox(Application::CreateMessageDialog(pParent, VclMessageType::Question,
- VclButtonsType::NONE, rMessage))
-{
- m_xQueryBox->set_title(Translate::get(STR_READONLYOPEN_TITLE, rResLocale));
- m_xQueryBox->add_button(Translate::get(STR_READONLYOPEN_BTN, rResLocale), RET_YES);
- m_xQueryBox->add_button(Translate::get(STR_READONLYOPEN_NOTIFY_BTN, rResLocale), RET_RETRY);
- m_xQueryBox->add_button(GetStandardText(StandardButtonType::Cancel), RET_CANCEL);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/uui/source/readonlyopen.hxx b/uui/source/readonlyopen.hxx
deleted file mode 100644
index 08063d10be0e..000000000000
--- a/uui/source/readonlyopen.hxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-#include <vcl/weld.hxx>
-
-class ReadOnlyOpenQueryBox
-{
-private:
- std::unique_ptr<weld::MessageDialog> m_xQueryBox;
-
-public:
- ReadOnlyOpenQueryBox(weld::Window* pParent, const std::locale& rResLocale,
- const OUString& rMessage);
- int run() { return m_xQueryBox->run(); }
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/uui/source/reloadeditable.cxx b/uui/source/reloadeditable.cxx
index 9dad2e183abf..e665c9a8efc7 100644
--- a/uui/source/reloadeditable.cxx
+++ b/uui/source/reloadeditable.cxx
@@ -19,7 +19,6 @@
#include <strings.hrc>
#include "reloadeditable.hxx"
-#include <officecfg/Office/Common.hxx>
#include <unotools/resmgr.hxx>
#include <vcl/stdtext.hxx>
#include <vcl/svapp.hxx>
diff --git a/uui/source/requeststringresolver.cxx b/uui/source/requeststringresolver.cxx
index e9d73f0749da..baaaf088713c 100644
--- a/uui/source/requeststringresolver.cxx
+++ b/uui/source/requeststringresolver.cxx
@@ -28,7 +28,7 @@ using namespace css;
UUIInteractionRequestStringResolver::UUIInteractionRequestStringResolver(
uno::Reference< uno::XComponentContext > const &
rxContext)
- : m_pImpl(new UUIInteractionHelper(rxContext))
+ : m_pImpl(rxContext)
{
}
@@ -63,7 +63,7 @@ UUIInteractionRequestStringResolver::getStringFromInformationalRequest(
{
try
{
- return m_pImpl->getStringFromRequest(Request);
+ return m_pImpl.getStringFromRequest(Request);
}
catch (uno::RuntimeException const & ex)
{
diff --git a/uui/source/requeststringresolver.hxx b/uui/source/requeststringresolver.hxx
index 685a18038c86..f9c95d87f6f5 100644
--- a/uui/source/requeststringresolver.hxx
+++ b/uui/source/requeststringresolver.hxx
@@ -23,9 +23,7 @@
#include <com/sun/star/task/XInteractionRequestStringResolver.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase.hxx>
-#include <memory>
-
-class UUIInteractionHelper;
+#include "iahndl.hxx"
class UUIInteractionRequestStringResolver:
public cppu::WeakImplHelper<
@@ -37,7 +35,7 @@ public:
css::uno::Reference< css::uno::XComponentContext > const & rxContext);
private:
- std::unique_ptr<UUIInteractionHelper> m_pImpl;
+ UUIInteractionHelper m_pImpl;
UUIInteractionRequestStringResolver(UUIInteractionRequestStringResolver const &) = delete;
void operator =(UUIInteractionRequestStringResolver const &) = delete;
diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index 601796e656a5..777ffbd8cf93 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -20,52 +20,33 @@
#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/xmlsechelper.hxx>
#include <vcl/svapp.hxx>
#include <osl/file.hxx>
-#include <osl/file.h>
#include <rtl/ustrbuf.hxx>
+#include <tools/datetime.hxx>
#include <tools/debug.hxx>
+#include <unotools/datetime.hxx>
+#include <unotools/resmgr.hxx>
#include <unotools/securityoptions.hxx>
#include <tools/urlobj.hxx>
-using namespace ::com::sun::star::security;
-
#include "secmacrowarnings.hxx"
-using namespace ::com::sun::star;
-
-
-// HACK!!! copied from xmlsecurity/source/dialog/resourcemanager.cxx
-
-namespace
-{
- OUString GetContentPart( const OUString& _rRawString, const OUString& _rPartId )
- {
- OUString s;
-
- sal_Int32 nContStart = _rRawString.indexOf( _rPartId );
- if( nContStart != -1 )
- {
- nContStart = nContStart + _rPartId.getLength();
- ++nContStart; // now its start of content, directly after Id
-
- sal_Int32 nContEnd = _rRawString.indexOf( ',', nContStart );
+#include <strings.hrc>
- if ( nContEnd != -1 )
- s = _rRawString.copy( nContStart, nContEnd - nContStart );
- else
- s = _rRawString.copy( nContStart );
- }
-
- return s;
- }
-}
+using namespace ::com::sun::star::security;
+using namespace ::com::sun::star;
+using namespace comphelper;
MacroWarning::MacroWarning(weld::Window* pParent, bool _bWithSignatures)
: MessageDialogController(pParent, "uui/ui/macrowarnmedium.ui", "MacroWarnMedium", "grid")
, mxGrid(m_xBuilder->weld_widget("grid"))
, mxSignsFI(m_xBuilder->weld_label("signsLabel"))
+ , mxNotYetValid(m_xBuilder->weld_label("certNotYetValidLabel"))
+ , mxNoLongerValid(m_xBuilder->weld_label("certNoLongerValidLabel"))
, mxViewSignsBtn(m_xBuilder->weld_button("viewSignsButton"))
+ , mxViewCertBtn(m_xBuilder->weld_button("viewCertButton"))
, mxAlwaysTrustCB(m_xBuilder->weld_check_button("alwaysTrustCheckbutton"))
, mxEnableBtn(m_xBuilder->weld_button("ok"))
, mxDisableBtn(m_xBuilder->weld_button("cancel"))
@@ -101,14 +82,19 @@ IMPL_LINK_NOARG(MacroWarning, ViewSignsBtnHdl, weld::Button&, void)
uno::Reference< security::XDocumentDigitalSignatures > xD(
security::DocumentDigitalSignatures::createWithVersion(comphelper::getProcessComponentContext(), maODFVersion));
- if( xD.is() )
- {
- xD->setParentWindow(m_xDialog->GetXWindow());
- if( mxCert.is() )
- xD->showCertificate( mxCert );
- else if( mxStore.is() )
- xD->showScriptingContentSignatures( mxStore, uno::Reference< io::XInputStream >() );
- }
+ if( !xD.is() )
+ return;
+
+ xD->setParentWindow(m_xDialog->GetXWindow());
+ if( mxCert.is() )
+ xD->showCertificate( mxCert );
+ else if( mxStore.is() )
+ xD->showScriptingContentSignatures( mxStore, uno::Reference< io::XInputStream >() );
+ else
+ return;
+
+ mxAlwaysTrustCB->set_sensitive(true);
+ EnableOkBtn(true);
}
IMPL_LINK_NOARG(MacroWarning, EnableBtnHdl, weld::Button&, void)
@@ -139,8 +125,8 @@ IMPL_LINK_NOARG(MacroWarning, DisableBtnHdl, weld::Button&, void)
IMPL_LINK_NOARG(MacroWarning, AlwaysTrustCheckHdl, weld::Toggleable&, void)
{
- const bool bEnable = (mnActSecLevel < 2 || mxAlwaysTrustCB->get_active());
- mxEnableBtn->set_sensitive(bEnable);
+ const bool bEnable = (mnActSecLevel < 3 || mxAlwaysTrustCB->get_active());
+ EnableOkBtn(bEnable);
mxDisableBtn->set_sensitive(!mxAlwaysTrustCB->get_active());
}
@@ -149,17 +135,16 @@ void MacroWarning::InitControls()
// show signature controls?
if (mbShowSignatures)
{
+ mxAlwaysTrustCB->connect_toggled(LINK(this, MacroWarning, AlwaysTrustCheckHdl));
+ mxAlwaysTrustCB->set_sensitive(false);
mxViewSignsBtn->connect_clicked(LINK(this, MacroWarning, ViewSignsBtnHdl));
- mxViewSignsBtn->set_sensitive(false);
-
- if (!SvtSecurityOptions::IsReadOnly(SvtSecurityOptions::EOption::MacroTrustedAuthors))
- mxAlwaysTrustCB->connect_toggled(LINK(this, MacroWarning, AlwaysTrustCheckHdl));
- else
- mxAlwaysTrustCB->set_visible(false);
+ mxViewSignsBtn->set_visible(false);
+ mxViewCertBtn->connect_clicked(LINK(this, MacroWarning, ViewSignsBtnHdl));
+ mxViewCertBtn->set_visible(false);
mnActSecLevel = SvtSecurityOptions::GetMacroSecurityLevel();
if ( mnActSecLevel >= 2 )
- mxEnableBtn->set_sensitive(false);
+ EnableOkBtn(false);
}
else
{
@@ -167,6 +152,13 @@ void MacroWarning::InitControls()
}
}
+void MacroWarning::EnableOkBtn(bool bEnable)
+{
+ mxEnableBtn->set_sensitive(bEnable);
+ std::locale aResLocale(Translate::Create("uui"));
+ mxEnableBtn->set_tooltip_text(bEnable ? "" : Translate::get(STR_VERIFY_CERT, aResLocale));
+}
+
void MacroWarning::SetStorage( const css::uno::Reference < css::embed::XStorage >& rxStore,
const OUString& aODFVersion,
const css::uno::Sequence< security::DocumentSignatureInformation >& rInfos )
@@ -178,17 +170,19 @@ void MacroWarning::SetStorage( const css::uno::Reference < css::embed::XStorage
return;
mpInfos = &rInfos;
- OUString aCN_Id("CN");
- OUStringBuffer s(GetContentPart( rInfos[ 0 ].Signer->getSubjectName(), aCN_Id ));
+ OUStringBuffer s(xmlsec::GetContentPart(rInfos[0].Signer->getSubjectName(),
+ rInfos[0].Signer->getCertificateKind()));
for( sal_Int32 i = 1 ; i < nCnt ; ++i )
{
- s.append("\n");
- s.append(GetContentPart( rInfos[ i ].Signer->getSubjectName(), aCN_Id ));
+ s.append(OUString::Concat("\n")
+ + xmlsec::GetContentPart(rInfos[i].Signer->getSubjectName(),
+ rInfos[0].Signer->getCertificateKind()));
}
mxSignsFI->set_label(s.makeStringAndClear());
- mxViewSignsBtn->set_sensitive(true);
+ mxViewSignsBtn->set_visible(true);
+ mxViewCertBtn->set_visible(false);
}
void MacroWarning::SetCertificate( const css::uno::Reference< css::security::XCertificate >& _rxCert )
@@ -196,9 +190,18 @@ void MacroWarning::SetCertificate( const css::uno::Reference< css::security::XCe
mxCert = _rxCert;
if( mxCert.is() )
{
- OUString s = GetContentPart( mxCert->getSubjectName(), "CN" );
+ OUString s(xmlsec::GetContentPart(mxCert->getSubjectName(), mxCert->getCertificateKind()));
mxSignsFI->set_label(s);
- mxViewSignsBtn->set_sensitive(true);
+
+ ::DateTime now( ::DateTime::SYSTEM );
+ DateTime aDateTimeStart( DateTime::EMPTY );
+ DateTime aDateTimeEnd( DateTime::EMPTY );
+ utl::typeConvert( mxCert->getNotValidBefore(), aDateTimeStart );
+ utl::typeConvert( mxCert->getNotValidAfter(), aDateTimeEnd );
+ mxNotYetValid->set_visible(now < aDateTimeStart);
+ mxNoLongerValid->set_visible(now > aDateTimeEnd);
+ mxViewSignsBtn->set_visible(false);
+ mxViewCertBtn->set_visible(true);
}
}
diff --git a/uui/source/secmacrowarnings.hxx b/uui/source/secmacrowarnings.hxx
index 300a5477bea5..463ccf1d9091 100644
--- a/uui/source/secmacrowarnings.hxx
+++ b/uui/source/secmacrowarnings.hxx
@@ -32,7 +32,10 @@ class MacroWarning : public weld::MessageDialogController
private:
std::unique_ptr<weld::Widget> mxGrid;
std::unique_ptr<weld::Label> mxSignsFI;
+ std::unique_ptr<weld::Label> mxNotYetValid;
+ std::unique_ptr<weld::Label> mxNoLongerValid;
std::unique_ptr<weld::Button> mxViewSignsBtn;
+ std::unique_ptr<weld::Button> mxViewCertBtn;
std::unique_ptr<weld::CheckButton> mxAlwaysTrustCB;
std::unique_ptr<weld::Button> mxEnableBtn;
std::unique_ptr<weld::Button> mxDisableBtn;
@@ -52,6 +55,7 @@ private:
DECL_STATIC_LINK(MacroWarning, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*);
void InitControls();
+ void EnableOkBtn(bool bEnable);
public:
MacroWarning(weld::Window* pParent, bool _bShowSignatures);
diff --git a/uui/source/unknownauthdlg.cxx b/uui/source/unknownauthdlg.cxx
index 9c96c7ba1dd4..783e6c3f48a4 100644
--- a/uui/source/unknownauthdlg.cxx
+++ b/uui/source/unknownauthdlg.cxx
@@ -50,7 +50,6 @@ UnknownAuthDialog::UnknownAuthDialog(
, m_xCommandButtonOK(m_xBuilder->weld_button("ok"))
, m_xView_Certificate(m_xBuilder->weld_button("examine"))
, m_xOptionButtonAccept(m_xBuilder->weld_radio_button("accept"))
- , m_xOptionButtonDontAccept(m_xBuilder->weld_radio_button("reject"))
, m_xContext(xContext)
, m_rXCert(rXCert)
{
diff --git a/uui/source/unknownauthdlg.hxx b/uui/source/unknownauthdlg.hxx
index 6c51ec4ebd3e..6e45a5d1db4b 100644
--- a/uui/source/unknownauthdlg.hxx
+++ b/uui/source/unknownauthdlg.hxx
@@ -31,7 +31,6 @@ private:
std::unique_ptr<weld::Button> m_xCommandButtonOK;
std::unique_ptr<weld::Button> m_xView_Certificate;
std::unique_ptr<weld::RadioButton> m_xOptionButtonAccept;
- std::unique_ptr<weld::RadioButton> m_xOptionButtonDontAccept;
const css::uno::Reference< css::uno::XComponentContext >& m_xContext;
const css::uno::Reference< css::security::XCertificate >& m_rXCert;
diff --git a/uui/uiconfig/ui/macrowarnmedium.ui b/uui/uiconfig/ui/macrowarnmedium.ui
index 83694b549fc1..4d7a416e83e9 100644
--- a/uui/uiconfig/ui/macrowarnmedium.ui
+++ b/uui/uiconfig/ui/macrowarnmedium.ui
@@ -1,36 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.2 -->
+<!-- Generated with glade 3.40.0 -->
<interface domain="uui">
<requires lib="gtk+" version="3.20"/>
<object class="GtkMessageDialog" id="MacroWarnMedium">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="title" translatable="yes" context="macrowarnmedium|MacroWarnMedium">%PRODUCTNAME - Security Warning</property>
<property name="modal">True</property>
- <property name="default_width">0</property>
- <property name="default_height">0</property>
- <property name="type_hint">dialog</property>
- <property name="message_type">warning</property>
- <property name="secondary_text" translatable="yes" context="macrowarnmedium|descr2Label">The document contains document macros.
+ <property name="default-width">0</property>
+ <property name="default-height">0</property>
+ <property name="type-hint">dialog</property>
+ <property name="message-type">warning</property>
+ <property name="secondary-text" translatable="yes" context="macrowarnmedium|descr2Label">The document contains document macros.
Macros may contain viruses. Disabling macros for a document is always safe. If you disable macros you may lose functionality provided by the document macros.</property>
<child internal-child="vbox">
<object class="GtkBox">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkButton" id="cancel">
<property name="label" translatable="yes" context="macrowarnmedium|cancel">_Disable Macros</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="can-default">True</property>
+ <property name="has-default">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -42,9 +42,9 @@ Macros may contain viruses. Disabling macros for a document is always safe. If y
<object class="GtkButton" id="ok">
<property name="label" translatable="yes" context="macrowarnmedium|ok">_Enable Macros</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -56,8 +56,8 @@ Macros may contain viruses. Disabling macros for a document is always safe. If y
<object class="GtkButton" id="help">
<property name="label" translatable="yes" context="stock">_Help</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="use-underline">True</property>
</object>
<packing>
@@ -75,47 +75,47 @@ Macros may contain viruses. Disabling macros for a document is always safe. If y
</packing>
</child>
<child>
- <!-- n-columns=1 n-rows=1 -->
+ <!-- n-columns=1 n-rows=5 -->
<object class="GtkGrid" id="grid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">6</property>
+ <property name="can-focus">False</property>
+ <property name="row-spacing">6</property>
<child>
<object class="GtkLabel" id="descr1Label">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes" context="macrowarnmedium|descr1Label">The document contains document macros signed by:</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="alwaysTrustCheckbutton">
<property name="label" translatable="yes" context="macrowarnmedium|alwaysTrustCheckbutton">_Always trust macros from this source</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="signsLabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
@@ -125,14 +125,14 @@ Macros may contain viruses. Disabling macros for a document is always safe. If y
</child>
<child>
<object class="GtkButton" id="viewSignsButton">
- <property name="label" translatable="yes" context="macrowarnmedium|viewSignsButton">_View Signatures…</property>
+ <property name="label" translatable="yes" context="macrowarnmedium|viewSignsButton">_Show Signatures…</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
- <property name="use_underline">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -140,10 +140,51 @@ Macros may contain viruses. Disabling macros for a document is always safe. If y
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="viewCertButton">
+ <property name="label" translatable="yes" context="macrowarnmedium|viewCertButton">_Show Certificate…</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <property name="hexpand">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="certNoLongerValidLabel">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="hexpand">True</property>
+ <property name="label" translatable="yes" context="macrowarnmedium|certNoLongerValidLabel">Warning: The certificate is no longer valid.</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="certNotYetValidLabel">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="hexpand">True</property>
+ <property name="label" translatable="yes" context="macrowarnmedium|certNotYetValidLabel">Warning: The certificate is not yet valid.</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
</packing>
</child>
</object>
@@ -159,8 +200,5 @@ Macros may contain viruses. Disabling macros for a document is always safe. If y
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
- <child>
- <placeholder/>
- </child>
</object>
</interface>
diff --git a/uui/uiconfig/ui/setmasterpassworddlg.ui b/uui/uiconfig/ui/setmasterpassworddlg.ui
index 073f24631517..1fd06e0e5c57 100644
--- a/uui/uiconfig/ui/setmasterpassworddlg.ui
+++ b/uui/uiconfig/ui/setmasterpassworddlg.ui
@@ -95,14 +95,43 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label2">
+ <!-- n-columns=2 n-rows=1 -->
+ <object class="GtkGrid">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_top">6</property>
- <property name="label" translatable="yes" context="setmasterpassworddlg|label2">_Enter password:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">password1</property>
- <property name="xalign">0</property>
+ <property name="can-focus">False</property>
+ <property name="column-spacing">12</property>
+ <property name="baseline-row">1</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="valign">end</property>
+ <property name="margin-top">6</property>
+ <property name="vexpand">True</property>
+ <property name="label" translatable="yes" context="setmasterpassworddlg|label2">_Enter password:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">password1</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="passpolicylabel">
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="halign">end</property>
+ <property name="margin-top">6</property>
+ <property name="hexpand">True</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -130,18 +159,30 @@
</packing>
</child>
<child>
+ <object class="GtkLevelBar" id="password1levelbar">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="tooltip-text" translatable="yes" context="setmasterpassworddlg|password1levelbar">Bar that displays password strength visually.</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="setmasterpassworddlg|label3">_Reenter password:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">password2</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">password2</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -161,7 +202,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
@@ -173,11 +214,14 @@
<property name="wrap">True</property>
<property name="max_width_chars">62</property>
<property name="xalign">0</property>
+ <attributes>
+ <attribute name="scale" value="0.9"/>
+ </attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
</object>