sw/inc/crsrsh.hxx                         |    5 -
 sw/qa/extras/uiwriter/data/tdf114973.fodt |  144 ++++++++++++++++++++++++++++++
 sw/qa/extras/uiwriter/uiwriter3.cxx       |   34 +++++++
 sw/source/core/crsr/callnk.cxx            |    2 
 sw/source/core/crsr/crsrsh.cxx            |   26 ++++-
 sw/source/core/edit/eddel.cxx             |    2 
 sw/source/core/edit/edglss.cxx            |    2 
 sw/source/core/frmedt/fetab.cxx           |    2 
 sw/source/core/text/frmcrsr.cxx           |    2 
 sw/source/uibase/shells/tabsh.cxx         |    2 
 sw/source/uibase/wrtsh/select.cxx         |    2 
 11 files changed, 208 insertions(+), 15 deletions(-)

New commits:
commit 0590cd2857f68f48b8847071a9c1a7dbef135721
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Jan 27 16:06:08 2023 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Thu Feb 9 13:43:19 2023 +0000

    tdf#114973 sw: enable SelectAll with hidden para at start/end
    
    If there's a hidden para the shell cursor can't be positioned in it
    ordinarily, so SelectAll will exclude these at the start or end of the
    document.
    
    There is already special code to handle a table at the start of the
    document body, and it's relatively simple to adapt it to handle hidden
    paragraphs as well.
    
    This appears to work surprisingly well, the point is at the start of the
    first node of the document, and moving it right immediately puts it to
    the first non-hidden paragraph.
    
    But it only works for paragraphs hidden by character formatting or
    hidden paragraph field, not if there's a hidden section - there are no
    (not even 0-height) SwTextFrames in hidden sections.
    
    Change-Id: Ifd3c11f4169a037fdae2c2b376d0138bec46774f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146257
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit bb733957dd39e6f0b9d80bb59eb0177188794797)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146206
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 2e9a9f0f1e62..c7148020bc2b 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -332,8 +332,9 @@ public:
     void ExtendedSelectAll(bool bFootnotes = true);
     /// If ExtendedSelectAll() was called and selection didn't change since 
then.
     bool ExtendedSelectedAll();
-    /// If document body starts with a table.
-    bool StartsWithTable();
+    enum class StartsWith { None, Table, HiddenPara };
+    /// If document body starts with a table or starts/ends with hidden 
paragraph.
+    StartsWith StartsWith_();
 
     SwCursor* GetCursor( bool bMakeTableCursor = true ) const;
     // return only the current cursor
diff --git a/sw/qa/extras/uiwriter/data/tdf114973.fodt 
b/sw/qa/extras/uiwriter/data/tdf114973.fodt
new file mode 100644
index 000000000000..8638cbbb6b4a
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf114973.fodt
@@ -0,0 +1,144 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<office:document xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:dc="http://purl.org/dc/eleme
 nts/1.1/" xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0
 " xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:font-face-decls>
+  <style:font-face style:name="Arial" svg:font-family="Arial" 
style:font-family-generic="swiss"/>
+  <style:font-face style:name="Lucida Sans" svg:font-family="'Lucida Sans'" 
style:font-family-generic="system" style:font-pitch="variable"/>
+  <style:font-face style:name="NSimSun" svg:font-family="NSimSun" 
style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+  <style:default-style style:family="graphic">
+   <style:graphic-properties svg:stroke-color="#3465a4" 
draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" 
draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" 
draw:start-line-spacing-vertical="0.283cm" 
draw:end-line-spacing-horizontal="0.283cm" 
draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" 
style:line-break="strict" style:font-independent-line-spacing="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties style:use-window-font-color="true" 
style:font-name="Arial" fo:font-size="12pt" fo:language="de" fo:country="DE" 
style:letter-kerning="true" style:font-name-asian="NSimSun" 
style:font-size-asian="10.5pt" style:language-asian="zh" 
style:country-asian="CN" style:font-name-complex="Lucida Sans" 
style:font-size-complex="12pt" style:language-complex="hi" 
style:country-complex="IN"/>
+  </style:default-style>
+  <style:default-style style:family="paragraph">
+   <style:paragraph-properties fo:orphans="2" fo:widows="2" 
fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" 
style:punctuation-wrap="hanging" style:line-break="strict" 
style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+   <style:text-properties style:use-window-font-color="true" 
style:font-name="Arial" fo:font-size="12pt" fo:language="de" fo:country="DE" 
style:letter-kerning="true" style:font-name-asian="NSimSun" 
style:font-size-asian="10.5pt" style:language-asian="zh" 
style:country-asian="CN" style:font-name-complex="Lucida Sans" 
style:font-size-complex="12pt" style:language-complex="hi" 
style:country-complex="IN" fo:hyphenate="false" 
fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" 
loext:hyphenation-no-caps="false"/>
+  </style:default-style>
+  <style:default-style style:family="table">
+   <style:table-properties table:border-model="collapsing"/>
+  </style:default-style>
+  <style:default-style style:family="table-row">
+   <style:table-row-properties fo:keep-together="auto"/>
+  </style:default-style>
+  <style:style style:name="Standard" style:family="paragraph" 
style:class="text"/>
+  <style:style style:name="Header_20_and_20_Footer" style:display-name="Header 
and Footer" style:family="paragraph" style:parent-style-name="Standard" 
style:class="extra">
+   <style:paragraph-properties text:number-lines="false" text:line-number="0">
+    <style:tab-stops>
+     <style:tab-stop style:position="8.5cm" style:type="center"/>
+     <style:tab-stop style:position="17cm" style:type="right"/>
+    </style:tab-stops>
+   </style:paragraph-properties>
+  </style:style>
+  <style:style style:name="Header" style:family="paragraph" 
style:parent-style-name="Header_20_and_20_Footer" style:class="extra">
+   <style:paragraph-properties text:number-lines="false" text:line-number="0">
+    <style:tab-stops>
+     <style:tab-stop style:position="8.5cm" style:type="center"/>
+     <style:tab-stop style:position="17cm" style:type="right"/>
+    </style:tab-stops>
+   </style:paragraph-properties>
+  </style:style>
+  <style:style style:name="Footer" style:family="paragraph" 
style:parent-style-name="Header_20_and_20_Footer" style:class="extra">
+   <style:paragraph-properties text:number-lines="false" text:line-number="0">
+    <style:tab-stops>
+     <style:tab-stop style:position="8.5cm" style:type="center"/>
+     <style:tab-stop style:position="17cm" style:type="right"/>
+    </style:tab-stops>
+   </style:paragraph-properties>
+  </style:style>
+  <text:outline-style style:name="Outline">
+   <text:outline-level-style text:level="1" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="2" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="3" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="4" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="5" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="6" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="7" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="8" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="9" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="10" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+  </text:outline-style>
+  <text:notes-configuration text:note-class="footnote" style:num-format="1" 
text:start-value="0" text:footnotes-position="page" 
text:start-numbering-at="document"/>
+  <text:notes-configuration text:note-class="endnote" style:num-format="i" 
text:start-value="0"/>
+  <text:linenumbering-configuration text:number-lines="false" 
text:offset="0.499cm" style:num-format="1" text:number-position="left" 
text:increment="5"/>
+ </office:styles>
+ <office:automatic-styles>
+  <style:page-layout style:name="pm1">
+   <style:page-layout-properties fo:page-width="21.001cm" 
fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" 
fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" 
fo:margin-right="2cm" style:writing-mode="lr-tb" 
style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" 
style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" 
style:layout-grid-mode="none" style:layout-grid-ruby-below="false" 
style:layout-grid-print="false" style:layout-grid-display="false" 
style:footnote-max-height="0cm">
+    <style:footnote-sep style:width="0.018cm" 
style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" 
style:line-style="solid" style:adjustment="left" style:rel-width="25%" 
style:color="#000000"/>
+   </style:page-layout-properties>
+   <style:header-style>
+    <style:header-footer-properties fo:min-height="0.998cm" 
fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0.499cm" 
fo:background-color="transparent" style:dynamic-spacing="false" 
draw:fill="none" draw:fill-color="#729fcf"/>
+   </style:header-style>
+   <style:footer-style>
+    <style:header-footer-properties fo:min-height="0.998cm" 
fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm" 
fo:background-color="transparent" style:dynamic-spacing="false" 
draw:fill="none" draw:fill-color="#729fcf"/>
+   </style:footer-style>
+  </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Standard" style:page-layout-name="pm1">
+   <style:header>
+    <text:p text:style-name="Header">Header</text:p>
+   </style:header>
+   <style:footer>
+    <text:p text:style-name="Footer">Footer</text:p>
+   </style:footer>
+  </style:master-page>
+ </office:master-styles>
+ <office:body>
+  <office:text>
+   <text:sequence-decls>
+    <text:sequence-decl text:display-outline-level="0" 
text:name="Illustration"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+   </text:sequence-decls>
+   <text:p text:style-name="Standard">hidden first 
paragraph<text:hidden-paragraph text:condition="ooow:TRUE" 
text:is-hidden="true"/></text:p>
+   <text:p text:style-name="Standard">Press CTRL+A for dispatching 
.uno:SelectAll. You see that nothing will be selected. The cursor jumps to the 
header</text:p>
+   <text:p text:style-name="Standard">hidden last 
paragraph<text:hidden-paragraph text:condition="ooow:TRUE" 
text:is-hidden="true"/></text:p>
+  </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index f1b50f047234..4cc56c2342ba 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -193,6 +193,40 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf149507)
     CPPUNIT_ASSERT_EQUAL(1, getPages());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf114973)
+{
+    createSwDoc("tdf114973.fodt");
+
+    dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    Scheduler::ProcessEventsToIdle();
+
+    SwDoc* const pDoc = getSwDoc();
+    SwWrtShell* const pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+    // bug: cursor jumped into header
+    CPPUNIT_ASSERT(!pWrtShell->IsInHeaderFooter());
+
+    dispatchCommand(mxComponent, ".uno:Copy", {});
+    Scheduler::ProcessEventsToIdle();
+
+    // check that hidden paragraphs at start and end are deleted
+    dispatchCommand(mxComponent, ".uno:Delete", {});
+    Scheduler::ProcessEventsToIdle();
+
+    CPPUNIT_ASSERT_EQUAL(int(1), getParagraphs());
+    CPPUNIT_ASSERT_EQUAL(OUString(), getParagraph(1)->getString());
+
+    // check that hidden paragraphs at start and end are copied
+    dispatchCommand(mxComponent, ".uno:Paste", {});
+    Scheduler::ProcessEventsToIdle();
+
+    CPPUNIT_ASSERT_EQUAL(int(3), getParagraphs());
+    CPPUNIT_ASSERT_EQUAL(OUString("hidden first paragraph"), 
getParagraph(1)->getString());
+    CPPUNIT_ASSERT_EQUAL(OUString("Press CTRL+A for dispatching 
.uno:SelectAll. You see that "
+                                  "nothing will be selected. The cursor jumps 
to the header"),
+                         getParagraph(2)->getString());
+    CPPUNIT_ASSERT_EQUAL(OUString("hidden last paragraph"), 
getParagraph(3)->getString());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145321)
 {
     createSwDoc("tdf145321.odt");
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 9ae4e14e856a..e3f08add1e30 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -90,7 +90,7 @@ void NotifyTableCollapsedParagraph(const SwContentNode *const 
pNode, SwCursorShe
 
     const SwTableLine* pLine = pRow->GetTabLine( );
 
-    if (pShell && (pShell->IsTableMode() || (pShell->StartsWithTable() && 
pShell->ExtendedSelectedAll())))
+    if (pShell && (pShell->IsTableMode() || (pShell->StartsWith_() != 
SwCursorShell::StartsWith::None && pShell->ExtendedSelectedAll())))
     {
         // If we have a table selection, then avoid the notification: it's not 
necessary (the text
         // cursor needs no updating) and the notification may kill the 
selection overlay, leading to
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index b270cdbe6334..bc78d12cb594 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -242,7 +242,7 @@ void SwCursorShell::StartAction()
 
 void SwCursorShell::EndAction( const bool bIdleEnd )
 {
-    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && 
ExtendedSelectedAll());
+    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWith_() != 
StartsWith::None && ExtendedSelectedAll());
     bool bVis = m_bSVCursorVis;
 
     // Idle-formatting?
@@ -623,12 +623,26 @@ bool SwCursorShell::ExtendedSelectedAll()
     return aStart == *pShellCursor->Start() && aEnd == *pShellCursor->End();
 }
 
-bool SwCursorShell::StartsWithTable()
+typename SwCursorShell::StartsWith SwCursorShell::StartsWith_()
 {
     SwNodes& rNodes = GetDoc()->GetNodes();
     SwNodeIndex nNode(rNodes.GetEndOfExtras());
     SwContentNode* pContentNode = rNodes.GoNext(&nNode);
-    return pContentNode->FindTableNode();
+    if (pContentNode->FindTableNode())
+    {
+        return StartsWith::Table;
+    }
+    if (pContentNode->GetTextNode()->IsHidden())
+    {
+        return StartsWith::HiddenPara;
+    }
+    nNode = rNodes.GetEndOfContent();
+    pContentNode = SwNodes::GoPrevious(&nNode);
+    if (pContentNode->GetTextNode()->IsHidden())
+    {
+        return StartsWith::HiddenPara;
+    }
+    return StartsWith::None;
 }
 
 bool SwCursorShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage )
@@ -1410,7 +1424,7 @@ void SwCursorShell::GoNextPrevCursorSetSearchLabel(const 
bool bNext)
 
 void SwCursorShell::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle &rRect)
 {
-    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && 
ExtendedSelectedAll());
+    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWith_() != 
StartsWith::None && ExtendedSelectedAll());
     CurrShell aCurr( this );
 
     // always switch off all cursors when painting
@@ -1495,7 +1509,7 @@ void SwCursorShell::UpdateCursorPos()
     SwShellCursor* pShellCursor = getShellCursor( true );
     Size aOldSz( GetDocSize() );
 
-    if( isInHiddenTextFrame(pShellCursor) )
+    if (isInHiddenTextFrame(pShellCursor) && !ExtendedSelectedAll())
     {
         SwCursorMoveState aTmpState( CursorMoveState::NONE );
         aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable();
@@ -2455,7 +2469,7 @@ void SwCursorShell::ShellLoseFocus()
 
 void SwCursorShell::ShellGetFocus()
 {
-    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && 
ExtendedSelectedAll());
+    comphelper::FlagRestorationGuard g(mbSelectAll, StartsWith_() != 
StartsWith::None && ExtendedSelectedAll());
 
     m_bHasFocus = true;
     if( !m_bBasicHideCursor && VisArea().Width() )
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 36a09afc3b25..f1d9824fce16 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -33,7 +33,7 @@
 
 void SwEditShell::DeleteSel(SwPaM& rPam, bool const isArtificialSelection, 
bool *const pUndo)
 {
-    bool bSelectAll = StartsWithTable() && ExtendedSelectedAll();
+    bool bSelectAll = StartsWith_() != SwCursorShell::StartsWith::None && 
ExtendedSelectedAll();
     // only for selections
     if (!rPam.HasMark()
         || (*rPam.GetPoint() == *rPam.GetMark()
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index 82a11ddbfe9c..836658d17236 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -197,7 +197,7 @@ bool SwEditShell::CopySelToDoc( SwDoc& rInsDoc )
         bool bColSel = GetCursor_()->IsColumnSelection();
         if( bColSel && rInsDoc.IsClipBoard() )
             rInsDoc.SetColumnSelection( true );
-        bool bSelectAll = StartsWithTable() && ExtendedSelectedAll();
+        bool bSelectAll = StartsWith_() != SwCursorShell::StartsWith::None && 
ExtendedSelectedAll();
         {
             for(SwPaM& rPaM : GetCursor()->GetRingContainer())
             {
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index d4348fe13a9d..c51413e3ba9b 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -189,7 +189,7 @@ void SwFEShell::InsertRow( sal_uInt16 nCnt, bool bBehind )
 
     // search boxes via the layout
     SwSelBoxes aBoxes;
-    bool bSelectAll = StartsWithTable() && ExtendedSelectedAll();
+    bool bSelectAll = StartsWith_() == StartsWith::Table && 
ExtendedSelectedAll();
     if (bSelectAll)
     {
         // Set the end of the selection to the last paragraph of the last cell 
of the table.
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index d6a7b798f429..0891a38321e7 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -180,7 +180,7 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const 
SwPosition &rPos,
 {
     OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTextFrame::GetCharRect with 
swapped frame" );
 
-    if( IsLocked() || IsHiddenNow() )
+    if (IsLocked())
         return false;
 
     // Find the right frame first. We need to keep in mind that:
diff --git a/sw/source/uibase/shells/tabsh.cxx 
b/sw/source/uibase/shells/tabsh.cxx
index 3082c5e36e98..94724a3018cc 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -175,7 +175,7 @@ static std::shared_ptr<SwTableRep> lcl_TableParamToItemSet( 
SfxItemSet& rSet, Sw
         rSet.Put(*aBoxDirection);
     }
 
-    bool bSelectAll = rSh.StartsWithTable() && rSh.ExtendedSelectedAll();
+    bool bSelectAll = rSh.StartsWith_() == SwCursorShell::StartsWith::Table && 
rSh.ExtendedSelectedAll();
     bool bTableSel = rSh.IsTableMode() || bSelectAll;
     if(!bTableSel)
     {
diff --git a/sw/source/uibase/wrtsh/select.cxx 
b/sw/source/uibase/wrtsh/select.cxx
index 11e84409941c..4cf35eb7d992 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -162,7 +162,7 @@ void SwWrtShell::SelAll()
         SttSelect();
         GoEnd(true, &bMoveTable);
 
-        bool bNeedsExtendedSelectAll = StartsWithTable();
+        bool bNeedsExtendedSelectAll = StartsWith_() != StartsWith::None;
 
         // If the cursor was in a table, then we only need the extended select
         // all if the whole table is already selected, to still allow selecting

Reply via email to