Skip to content

Commit ebea5ef

Browse files
committed
tdf#165185: consider LOK read-only view in SID_SEARCH_OPTIONS
This reverts commit cae3ed9 "disable invoking Search and Replace dialog (by Ctrl+H) in read-only documents", 2025-02-11. Instead, the dialog will disable replacement controls. Change-Id: Iefef1f636492f60b2bcff07379c2c2dc7bcead79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181408 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]>
1 parent e52899e commit ebea5ef

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

sc/source/ui/view/tabvwsha.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
254254
SearchOptionFlags nOptions = SearchOptionFlags::ALL;
255255

256256
// No replacement if ReadOnly
257-
if (GetViewData().GetDocShell()->IsReadOnly())
257+
if (GetViewData().GetDocShell()->IsReadOnly() || IsCurrentLokViewReadOnly())
258258
nOptions &= ~SearchOptionFlags( SearchOptionFlags::REPLACE | SearchOptionFlags::REPLACE_ALL );
259259
rSet.Put( SfxUInt16Item( nWhich, static_cast<sal_uInt16>(nOptions) ) );
260260
}

sd/source/ui/docshell/docshell.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void DrawDocShell::GetState(SfxItemSet &rSet)
241241
SearchOptionFlags::SIMILARITY |
242242
SearchOptionFlags::SELECTION;
243243

244-
if (!IsReadOnly())
244+
if (!IsReadOnly() && !SfxViewShell::IsCurrentLokViewReadOnly())
245245
{
246246
nOpt |= SearchOptionFlags::REPLACE;
247247
nOpt |= SearchOptionFlags::REPLACE_ALL;

sfx2/sdi/sfx.sdi

+1-1
Original file line numberDiff line numberDiff line change
@@ -4002,7 +4002,7 @@ SfxBoolItem SearchDialog SID_SEARCH_DLG
40024002
[
40034003
AutoUpdate = TRUE,
40044004
FastCall = FALSE,
4005-
ReadOnlyDoc = FALSE,
4005+
ReadOnlyDoc = TRUE,
40064006
Toggle = FALSE,
40074007
Container = FALSE,
40084008
RecordAbsolute = FALSE,

sw/source/uibase/uiview/viewsrch.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ void SwView::StateSearch(SfxItemSet &rSet)
869869
case SID_SEARCH_OPTIONS:
870870
{
871871
SearchOptionFlags nOpt = SearchOptionFlags::ALL;
872-
if( GetDocShell()->IsReadOnly() )
872+
if (GetDocShell()->IsReadOnly() || IsCurrentLokViewReadOnly())
873873
nOpt &= ~SearchOptionFlags( SearchOptionFlags::REPLACE |
874874
SearchOptionFlags::REPLACE_ALL );
875875
rSet.Put( SfxUInt16Item( SID_SEARCH_OPTIONS, static_cast<sal_uInt16>(nOpt) ));

0 commit comments

Comments
 (0)