summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-04-25 14:53:33 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2022-04-26 10:39:31 +0200
commit404c51f3664ffd4f7e2c1c8bb8a12ac70954fec2 (patch)
treeb38e7a5088e4c3cbd1b7ea447b03fb595bd8f1ba /sfx2/source/appl
parentc51ef466f736c9e0e192d2c7feeda0a39bca2011 (diff)
officecfg,unotools,framework,sfx2: store ReadOnly for recent docs
Add Office::Histories::HistoryItem::ReadOnly flag to configuration so that a document that was opened read-only isn't opened as editable from recent documents. Change-Id: I6985da287d3337a53a7e41e8e500421038eedb91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133385 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/newhelp.cxx4
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx4
2 files changed, 6 insertions, 2 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index a120a99f41bb..289a848b4b36 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1186,7 +1186,9 @@ BookmarksTabPage_Impl::~BookmarksTabPage_Impl()
SvtHistoryOptions::Clear( EHistoryType::HelpBookmarks );
const sal_Int32 nCount = m_xBookmarksBox->n_children();
for (sal_Int32 i = 0; i < nCount; ++i)
- SvtHistoryOptions::AppendItem(EHistoryType::HelpBookmarks, m_xBookmarksBox->get_id(i), "", m_xBookmarksBox->get_text(i), std::nullopt);
+ {
+ SvtHistoryOptions::AppendItem(EHistoryType::HelpBookmarks, m_xBookmarksBox->get_id(i), "", m_xBookmarksBox->get_text(i), std::nullopt, std::nullopt);
+ }
m_xBookmarksBox.reset();
m_xBookmarksPB.reset();
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 83834597aff0..8d929d1ad68b 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -123,13 +123,15 @@ void SfxPickListImpl::AddDocumentToPickList( const SfxObjectShell* pDocSh )
}
}
}
+ ::std::optional<bool> const oIsReadOnly(pDocSh->IsReadOnly());
// add to svtool history options
SvtHistoryOptions::AppendItem( EHistoryType::PickList,
aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ),
aFilter,
aTitle,
- aThumbnail);
+ aThumbnail,
+ oIsReadOnly);
if ( aURL.GetProtocol() == INetProtocol::File )
Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::DecodeMechanism::NONE ),