summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-04-19 12:35:30 +0200
committerMichael Stahl <mstahl@redhat.com>2017-04-19 13:02:18 +0200
commit31aac86f14d088628979c7809588f14bef643feb (patch)
tree9611b9252d45598c431ddbd1dca300fed58586a2
parent876e13576bf112786172fdc113363f3fe54f19f7 (diff)
sw: replace rudimentary SwCursorShell::m_nBasicActionCnt
The functions to modify the counter were removed in 2004-2006 and there is no evidence in the git repo of these functions ever being called, so the BasicActionPend() condition is effectively equivalent to ActionPend(). Change-Id: Ic8b9c8c6039c318943c96e90f2370cb5a1046ff9
-rw-r--r--sw/inc/crsrsh.hxx3
-rw-r--r--sw/source/core/crsr/crsrsh.cxx35
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx2
-rw-r--r--sw/source/uibase/uiview/view.cxx4
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx7
5 files changed, 10 insertions, 41 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 122cda1406a8..7c5a8dff88dc 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -203,7 +203,6 @@ private:
* (via Find()) can be realised.
*/
sal_uInt16 m_nCursorMove;
- sal_uInt16 m_nBasicActionCnt; ///< Actions which are parenthesized by Basic
CursorMoveState m_eMvState; ///< Status for Cursor-Travelling - GetCursorOfst
OUString m_sMarkedListId;
@@ -747,8 +746,6 @@ public:
// is the whole document protected/hidden (for UI...)
bool IsAllProtect() const { return m_bAllProtect; }
- bool BasicActionPend() const { return m_nBasicActionCnt != mnStartAction; }
-
bool GotoRegion( const OUString& rName );
// show the current selection
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index eca8374a9cda..e22be8f4a772 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -264,29 +264,6 @@ void SwCursorShell::EndAction( const bool bIdleEnd, const bool DoSetPosX )
if( bVis ) // display SV-Cursor again
m_pVisibleCursor->Show();
- // If there is still a ChgCall and just the "basic
- // parenthising(?)" exists, call it. This
- // decouples the internal with the Basic-parenthising, the
- // Shells are switched.
- if( !BasicActionPend() )
- {
- // Within a Basic action, one needs to update the cursor,
- // to e.g. create the table cursor. This is being done in
- // UpdateCursor.
- UpdateCursor( eFlags, bIdleEnd );
-
- {
- // watch Cursor-Moves, call Link if needed, the DTOR is key here!
- SwCallLink aLk( *this, m_nAktNode, m_nAktContent, m_nAktNdTyp,
- m_nLeftFramePos, m_bAktSelection );
-
- }
- if( m_bCallChgLnk && m_bChgCallFlag && m_aChgLnk.IsSet() )
- {
- m_aChgLnk.Call( this );
- m_bChgCallFlag = false; // reset flag
- }
- }
return;
}
@@ -1434,9 +1411,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd )
SET_CURR_SHELL( this );
ClearUpCursors();
- // In a BasicAction the cursor must be updated, e.g. to create the
- // TableCursor. EndAction now calls UpdateCursor!
- if( ActionPend() && BasicActionPend() )
+ if (ActionPend())
{
if ( eFlags & SwCursorShell::READONLY )
m_bIgnoreReadonly = true;
@@ -2275,9 +2250,9 @@ bool SwCursorShell::HasSelection() const
void SwCursorShell::CallChgLnk()
{
- // Do not make any call in start/end action but just remember the change.
- // This will be taken care of in the end action.
- if( BasicActionPend() )
+ // Do not make any call in StartAction/EndAction but just set the flag.
+ // This will be handled in EndAction.
+ if (ActionPend())
m_bChgCallFlag = true; // remember change
else if( m_aChgLnk.IsSet() )
{
@@ -2662,7 +2637,6 @@ SwCursorShell::SwCursorShell( SwCursorShell& rShell, vcl::Window *pInitWin )
, m_nAktNdTyp(SwNodeType::NONE)
, m_bAktSelection(false)
, m_nCursorMove( 0 )
- , m_nBasicActionCnt( 0 )
, m_eMvState( MV_NONE )
, m_sMarkedListId()
, m_nMarkedListLevel( 0 )
@@ -2700,7 +2674,6 @@ SwCursorShell::SwCursorShell( SwDoc& rDoc, vcl::Window *pInitWin,
, m_nAktNdTyp(SwNodeType::NONE)
, m_bAktSelection(false)
, m_nCursorMove( 0 )
- , m_nBasicActionCnt( 0 )
, m_eMvState( MV_NONE ) // state for crsr-travelling - GetCursorOfst
, m_sMarkedListId()
, m_nMarkedListLevel( 0 )
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 1562752f40a5..27171bf0e836 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -415,7 +415,7 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
// when pending we will not get the correct type, but SelectionType::Text
// as fallback. This *happens* during D&D, so we need to check if we are in
// the fallback and just try to get a graphic
- const bool bPending(m_pWrtShell->BasicActionPend());
+ const bool bPending(m_pWrtShell->ActionPend());
// SEL_GRF is from ContentType of editsh
if(bPending || ((SelectionType::Graphic | SelectionType::DbForm) & nSelectionType))
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 200e85432559..c2b2d9ea72e9 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -475,7 +475,7 @@ IMPL_LINK_NOARG(SwView, AttrChangedNotify, SwCursorShell*, void)
if( !m_bAttrChgNotified )
{
- if ( m_pWrtShell->BasicActionPend() || g_bNoInterrupt ||
+ if (m_pWrtShell->ActionPend() || g_bNoInterrupt ||
GetDispatcher().IsLocked() || //do not confuse the SFX
GetViewFrame()->GetBindings().IsInUpdate() )//do not confuse the SFX
{
@@ -508,7 +508,7 @@ IMPL_LINK_NOARG(SwView, AttrChangedNotify, SwCursorShell*, void)
IMPL_LINK_NOARG(SwView, TimeoutHdl, Timer *, void)
{
- if( m_pWrtShell->BasicActionPend() || g_bNoInterrupt )
+ if (m_pWrtShell->ActionPend() || g_bNoInterrupt)
{
m_aTimer.Start();
return;
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 9e7e6005abc6..18139d02318c 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1352,12 +1352,11 @@ void SwWrtShell::BulletOn()
SelectionType SwWrtShell::GetSelectionType() const
{
- // ContentType cannot be determined within a
- // Start-/Endaction parentheses.
+ // ContentType cannot be determined within a Start-/EndAction.
// Because there is no invalid value TEXT will be returned.
- // The value does not matter, it may be updated in endaction anyway.
+ // The value does not matter, it may be updated in EndAction anyway.
- if ( BasicActionPend() )
+ if (ActionPend())
return IsSelFrameMode() ? SelectionType::Frame : SelectionType::Text;
SwView &_rView = const_cast<SwView&>(GetView());