summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-09-16 16:25:15 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-09-16 17:09:48 +0200
commit4b6445dba6bb5b2aed3edb4878ecb327446286e9 (patch)
tree57e83ac4bb6f1ad75375b7179027168ac705e00b
parentba511f8002a2da521f06c3a6a0c60aa6de79d170 (diff)
fdo#37606 SwWrtShell: fix select all when doc starts with table and cursor ...
... is outside that table Change-Id: Id61723a3b4c8265d822bccffe63b30038fcc5eab
-rw-r--r--sw/source/core/crsr/crsrsh.cxx1
-rw-r--r--sw/source/ui/wrtsh/select.cxx7
2 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 89698a99d762..e64b63d65fa5 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1158,6 +1158,7 @@ sal_Bool SwCrsrShell::GoPrevCrsr()
void SwCrsrShell::Paint( const Rectangle &rRect)
{
+ comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll());
SET_CURR_SHELL( this );
// always switch off all cursors when painting
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 4ad3f6a6e6c8..149d2993f098 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -160,7 +160,8 @@ long SwWrtShell::SelAll()
SttSelect();
GoEnd(sal_True, &bMoveTable);
- if (StartsWithTable())
+ bool bStartsWithTable = StartsWithTable();
+ if (bStartsWithTable)
ExtendedSelectAll();
if( pStartPos )
@@ -173,9 +174,9 @@ long SwWrtShell::SelAll()
// if the last selection was behind the first section or
// if the last selection was already the first section
// In this both cases we select to the end of document
- if( *pTmpCrsr->GetPoint() < *pEndPos ||
+ if( ( *pTmpCrsr->GetPoint() < *pEndPos ||
( *pStartPos == *pTmpCrsr->GetMark() &&
- *pEndPos == *pTmpCrsr->GetPoint() ) )
+ *pEndPos == *pTmpCrsr->GetPoint() ) ) && !bStartsWithTable)
SwCrsrShell::SttEndDoc(sal_False);
}
delete pStartPos;