summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/AnnotationWin.hxx2
-rw-r--r--sw/source/uibase/docvw/AnnotationMenuButton.cxx15
-rw-r--r--sw/source/uibase/docvw/AnnotationWin.cxx2
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx2
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.cxx4
-rw-r--r--sw/source/uibase/shells/annotsh.cxx2
6 files changed, 13 insertions, 14 deletions
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index 2aa641361ebf..e3d6e509d216 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -82,7 +82,7 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public InterimItemWindow
sal_uInt32 CalcParent();
void InitAnswer(OutlinerParaObject const & rText);
- bool IsProtected() const;
+ bool IsReadOnlyOrProtected() const;
void SetSize( const Size& rNewSize );
void SetPosSizePixelRect( tools::Long nX,
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index 1696f7e6d338..fe0143d8c3c3 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -66,13 +66,9 @@ IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, weld::Toggleable&, void)
if (!mxMenuButton->get_active())
return;
- bool bReplyVis = true;
-
bool bReadOnly = IsReadOnly();
if (bReadOnly)
{
- mxMenuButton->set_item_visible("reply", false);
- bReplyVis = false;
mxMenuButton->set_item_visible("resolve", false);
mxMenuButton->set_item_visible("unresolve", false);
mxMenuButton->set_item_visible("resolvethread", false);
@@ -85,7 +81,7 @@ IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, weld::Toggleable&, void)
mxMenuButton->set_item_visible("unresolve", IsResolved());
mxMenuButton->set_item_visible("resolvethread", !IsThreadResolved());
mxMenuButton->set_item_visible("unresolvethread", IsThreadResolved());
- mxMenuButton->set_item_visible("delete", !IsProtected());
+ mxMenuButton->set_item_visible("delete", !IsReadOnlyOrProtected());
}
mxMenuButton->set_item_visible("deletethread", !bReadOnly);
@@ -93,7 +89,10 @@ IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, weld::Toggleable&, void)
mxMenuButton->set_item_visible("deleteall", !bReadOnly);
mxMenuButton->set_item_visible("formatall", !bReadOnly);
- if (IsProtected())
+ bool bReplyVis = true;
+
+ // No answer possible if this note is in a protected section.
+ if (IsReadOnlyOrProtected())
{
mxMenuButton->set_item_visible("reply", false);
bReplyVis = false;
@@ -109,10 +108,10 @@ IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, weld::Toggleable&, void)
sAuthor = SwResId(STR_REDLINE_UNKNOWN_AUTHOR);
}
}
- // do not allow to reply to ourself and no answer possible if this note is in a protected section
+ // do not allow to reply to ourself
bReplyVis = sAuthor != GetAuthor();
- mxMenuButton->set_item_visible("reply", bReplyVis);
}
+ mxMenuButton->set_item_visible("reply", bReplyVis);
mxMenuButton->set_item_visible("sep1", bReplyVis);
}
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx
index dcaf84550af6..b28c66f03650 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -503,7 +503,7 @@ SvxLanguageItem SwAnnotationWin::GetLanguage() const
return SvxLanguageItem(mpField->GetLanguage(),nLangWhichId);
}
-bool SwAnnotationWin::IsProtected() const
+bool SwAnnotationWin::IsReadOnlyOrProtected() const
{
return mbReadonly ||
GetLayoutStatus() == SwPostItHelper::DELETED ||
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index a9b1e468acb2..eff0c82571d8 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -1067,7 +1067,7 @@ void SwAnnotationWin::DeactivatePostIt()
if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
GetOutlinerView()->SetBackgroundColor(COL_TRANSPARENT);
- if (!mnDeleteEventId && !IsProtected() && mpOutliner->GetEditEngine().GetText().isEmpty())
+ if (!mnDeleteEventId && !IsReadOnlyOrProtected() && mpOutliner->GetEditEngine().GetText().isEmpty())
{
mnDeleteEventId = Application::PostUserEvent( LINK( this, SwAnnotationWin, DeleteHdl), nullptr, true );
}
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index b08758a611a0..7be7fe37c61e 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -325,7 +325,7 @@ bool SidebarTextControl::KeyInput( const KeyEvent& rKeyEvt )
/// HACK: need to switch off processing of Undo/Redo in Outliner
if ( !( (nKey == KEY_Z || nKey == KEY_Y) && rKeyCode.IsMod1()) )
{
- bool bIsProtected = mrSidebarWin.IsProtected();
+ bool bIsProtected = mrSidebarWin.IsReadOnlyOrProtected();
if ( !bIsProtected || !EditEngine::DoesKeyChangeText(rKeyEvt) )
{
EditView* pEditView = GetEditView();
@@ -416,7 +416,7 @@ bool SidebarTextControl::Command( const CommandEvent& rCEvt )
{
if (IsMouseCaptured())
ReleaseMouse();
- if ( !mrSidebarWin.IsProtected() &&
+ if ( !mrSidebarWin.IsReadOnlyOrProtected() &&
pEditView &&
pEditView->IsWrongSpelledWordAtPos( rCEvt.GetMousePosPixel(), true ))
{
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 9e9fd0f2c07a..112cf98d3095 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -1247,7 +1247,7 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
if (pPostItMgr && pPostItMgr->HasActiveSidebarWin())
{
- if ( (pPostItMgr->GetActiveSidebarWin()->IsProtected()) &&
+ if ( (pPostItMgr->GetActiveSidebarWin()->IsReadOnlyOrProtected()) &&
( (nSlotId==FN_DELETE_COMMENT) || (nSlotId==FN_REPLY) ) )
rSet.DisableItem( nWhich );
}