[Libreoffice-bugs] [Bug 137926] storeAsURL regression between libreoffice < 7 and libreoffice >=7
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Tue Oct 5 04:49:36 UTC 2021
https://bugs.documentfoundation.org/show_bug.cgi?id=137926
--- Comment #9 from Ross Johnson <ross.johnson at homemail.com.au> ---
(In reply to libreoffice from comment #4)
> I tried to rewrote this part to fix this use-case:
>
> ```
> // Also, ( maybe the new itemset contains new values, otherwise they will be
> empty )
> bool bPasswordProtected = true;
>
> if (xMergedParams->HasItem(SID_ENCRYPTIONDATA))
> {
> const SfxUnoAnyItem* pEncryptionDataItem
> = xMergedParams->GetItem<SfxUnoAnyItem>(SID_ENCRYPTIONDATA,
> false);
> if (pEncryptionDataItem)
> {
> uno::Sequence<beans::NamedValue> aEncryptionData;
> pEncryptionDataItem->GetValue() >>= aEncryptionData;
> for (const auto& rItem : std::as_const(aEncryptionData))
> {
> if (rItem.Name == "CryptoType")
> {
> OUString aValue;
> rItem.Value >>= aValue;
> if (aValue != "StrongEncryptionDataSpace")
> {
> // This is not just a password protected document.
> Let's keep encryption data as is.
> bPasswordProtected = false;
> }
> break;
> }
> }
> }
> }else if (xMergedParams->HasItem( SID_PASSWORD )){
> bPasswordProtected = true;
> }
> if (bPasswordProtected){
> // For password protected documents remove encryption data during
> "Save as..."
> xMergedParams->ClearItem(SID_PASSWORD);
> xMergedParams->ClearItem(SID_ENCRYPTIONDATA);
> }
> ```
The first:
bool bPasswordProtected = true;
in your patch makes your 'else if' redundant, so is surely not what you
intended.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20211005/af1809fd/attachment-0001.htm>
More information about the Libreoffice-bugs
mailing list