https://bugs.documentfoundation.org/show_bug.cgi?id=137926
--- Comment #9 from Ross Johnson <[email protected]> --- (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.
