summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2023-04-08 16:05:26 +0200
committerBalazs Varga <balazs.varga.extern@allotropia.de>2023-04-17 23:33:09 +0200
commit6feafa2c5a2c593b1852ac44e2ea88eb9375c01d (patch)
tree68538cea0deb9ba8fef471c96c53cd0f006cd393 /sw/inc
parent5713871497f81bd4b4196a217c9084f2db3e6614 (diff)
tdf#130199 sw Confirm deletion of hidden sections
To enhance the existing discoverability of hidden sections via Navigator by a confirmation box when a hidden section is to be deleted. Also add an option to switch on/off this warning message named "ShowWarningHiddenSection". The default setting is on. Change-Id: I91a1a32524f8d8d8fd0f230c142654df4367e729 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150231 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/crsrsh.hxx1
-rw-r--r--sw/inc/editsh.hxx14
-rw-r--r--sw/inc/pam.hxx2
-rw-r--r--sw/inc/swcrsr.hxx2
4 files changed, 19 insertions, 0 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index ddb7b301beef..319911a33e65 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -486,6 +486,7 @@ public:
// Cursor is placed in something that is protected or selection contains
// something that is protected.
bool HasReadonlySel(bool isReplace = false) const;
+ bool HasHiddenSections() const;
// Can the cursor be set to read only ranges?
bool IsReadOnlyAvailable() const { return m_bSetCursorInReadOnly; }
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 663a0ffc35f7..8711b132c745 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -81,6 +81,7 @@ class SwLineNumberInfo;
class SwAuthEntry;
class SwRewriter;
class SwView;
+class SwWrtShell;
struct SwConversionArgs;
struct SvxSwAutoFormatFlags;
struct SwInsertTableOptions;
@@ -623,6 +624,19 @@ public:
/// Apply ViewOptions with Start-/EndAction.
virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
+ /// Selected area has readonly content
+ virtual void InfoReadOnlyDialog(bool /*bAsync*/) const
+ {
+ // override in SwWrtShell
+ }
+
+ /// Selected area has hidden content
+ virtual bool WarnHiddenSectionDialog() const
+ {
+ // override in SwWrtShell
+ return true;
+ }
+
/** Query text within selection. */
void GetSelectedText( OUString &rBuf,
ParaBreakType nHndlParaBreak = ParaBreakType::ToBlank );
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 746fa22840c0..2a7a0cdb8bd3 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -309,6 +309,8 @@ public:
/** Is in something protected (readonly) or selection contains
something protected. */
bool HasReadonlySel(bool bFormView, bool isReplace) const;
+ /** Is there hidden sections in the selected area. */
+ bool HasHiddenSections() const;
bool ContainsPosition(const SwPosition & rPos) const
{
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 486507b23c4e..570780080f5e 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -283,6 +283,8 @@ public:
SwCursor* MakeBoxSels( SwCursor* pCurrentCursor );
// Any boxes protected?
bool HasReadOnlyBoxSel() const;
+ // Any boxes hidden?
+ bool HasHiddenBoxSel() const;
// Has table cursor been changed? If so, save new values immediately.
bool IsCursorMovedUpdate();