summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorSteve Yin <steve_y@apache.org>2014-01-06 07:40:48 +0000
committerMichael Meeks <michael.meeks@collabora.com>2014-06-10 16:33:53 +0100
commit849f62650a1527772a2d1425334b792734825299 (patch)
tree22ec77b495f2fc9382dbff72572679e3700768fc /sc
parent48b3bdada6a35615f813b149a859781dc456c7b0 (diff)
Resolves: #i123629# [ia2] Invalid focus event fired after editing cell
Some Coverity issues fixes (cherry picked from commit 5478c54be2de808663565e53250c8a4055b390c9) Conflicts: sc/source/ui/inc/AccessibleCell.hxx sc/source/ui/inc/tabvwsh.hxx sc/source/ui/view/cellsh4.cxx sc/source/ui/view/tabvwsh4.cxx Rolled back some coverity issue fixes for mac build (cherry picked from commit 15e6a8263ae6181ac4912b94af8cb63adc34a86d) Conflicts: sc/source/ui/inc/AccessibleCell.hxx a727d3c7f819c8d0082a9fb017351d5307877fa6 Change-Id: I03b63c655bd55e5fb92d95490eaa4bb081b8ee7d
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx9
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx2
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx8
-rw-r--r--sc/source/ui/view/cellsh4.cxx6
-rw-r--r--sc/source/ui/view/tabview3.cxx4
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx1
6 files changed, 24 insertions, 6 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index ccc8e0e00086..fe439d102018 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1035,10 +1035,13 @@ sal_Bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawin
++aDataItr;
}
bool bWinFocus=false;
- ScGridWindow* pWin = static_cast<ScGridWindow*>(mpViewShell->GetWindowByPos(meSplitPos));
- if (pWin)
+ if (mpViewShell)
{
- bWinFocus = pWin->HasFocus();
+ ScGridWindow* pWin = static_cast<ScGridWindow*>(mpViewShell->GetWindowByPos(meSplitPos));
+ if (pWin)
+ {
+ bWinFocus = pWin->HasFocus();
+ }
}
const SdrMarkList* pMarkList = NULL;
SdrObject* pMarkedObj = NULL;
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 5a525d0c43ff..29c22425383d 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -472,7 +472,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
pAccDoc->CommitChange(aEvent);
}
}
- sal_Bool bNewPosCell = (aNewCell != maActiveCell);
+ sal_Bool bNewPosCell = (aNewCell != maActiveCell) || mpViewShell->GetForceFocusOnCurCell(); // #i123629#
sal_Bool bNewPosCellFocus=sal_False;
if ( bNewPosCell && IsFocused() && aNewCell.Tab() == maActiveCell.Tab() )
{//single Focus
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index a6d4f0effe30..083befed2a53 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -165,7 +165,9 @@ private:
SbxObject* pScSbxObject;
- sal_Bool bChartAreaValid; // if chart is drawn
+ sal_Bool bChartAreaValid; // if chart is drawn
+ sal_Bool bForceFocusOnCurCell; // #i123629#
+
OUString aEditChartName;
ScRangeListRef aChartSource;
Rectangle aChartPos;
@@ -182,7 +184,6 @@ private:
bool mbInSwitch;
OUString maName;
OUString maScope;
-
private:
void Construct( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE );
@@ -418,6 +419,9 @@ public:
// ugly hack to call Define Names from Manage Names
void SwitchBetweenRefDialogs(SfxModelessDialog* pDialog);
+ // #i123629#
+ sal_Bool GetForceFocusOnCurCell() const { return bForceFocusOnCurCell; }
+ void SetForceFocusOnCurCell(sal_Bool bFlag) { bForceFocusOnCurCell=bFlag; }
};
//==================================================================
diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx
index 945909c349ad..ffeaad0d72d8 100644
--- a/sc/source/ui/view/cellsh4.cxx
+++ b/sc/source/ui/view/cellsh4.cxx
@@ -119,6 +119,12 @@ void ScCellShell::ExecuteCursor( SfxRequest& rReq )
// once extra, so that the cursor will not be painted too often with ExecuteInputDirect:
pTabViewShell->HideAllCursors();
+ // #i123629#
+ if( pTabViewShell->GetCurObjectSelectionType() == OST_Editing )
+ pTabViewShell->SetForceFocusOnCurCell(sal_True);
+ else
+ pTabViewShell->SetForceFocusOnCurCell(sal_False);
+
//OS: once for all should do, however!
pTabViewShell->ExecuteInputDirect();
switch ( nSlotId )
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 2a79b15694f4..557bdbd88d18 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -991,6 +991,10 @@ void ScTabView::MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
if (!bKeepOld)
aViewData.ResetOldCursor();
+ // #i123629#
+ if( aViewData.GetViewShell()->GetForceFocusOnCurCell() )
+ aViewData.GetViewShell()->SetForceFocusOnCurCell( !ValidColRow(nCurX, nCurY) );
+
if (nCurX < 0) nCurX = 0;
if (nCurY < 0) nCurY = 0;
if (nCurX > MAXCOL) nCurX = MAXCOL;
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 99ff4adae598..101f4b20c4e6 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1509,6 +1509,7 @@ bool ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
bReadOnly(false), \
pScSbxObject(NULL), \
bChartAreaValid(false), \
+ bForceFocusOnCurCell(false),\
nCurRefDlgId(0), \
pAccessibilityBroadcaster(NULL), \
mbInSwitch(false)