summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-03 00:43:04 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-03 03:56:11 +0100
commit204e3eb3813524bf21aae58a76f54f29b969e9ed (patch)
treebab75cc120a7237e71f5d6cb4ea9c3de09f506a7
parent06842a8583d3d77de74964cdce4fba811818bf90 (diff)
ugly hack to avoid virtual method in Window
Change-Id: I7ffc13167f5ecbfe3afab6451e1ef52e81130d48
-rw-r--r--sc/source/ui/app/scmod.cxx29
-rw-r--r--sc/source/ui/inc/gridwin.hxx4
-rw-r--r--sc/source/ui/inc/tabview.hxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx11
-rw-r--r--sc/source/ui/view/tabview.cxx11
-rw-r--r--tools/inc/tools/wintypes.hxx1
-rw-r--r--vcl/inc/vcl/window.hxx5
-rw-r--r--vcl/source/window/window.cxx9
-rw-r--r--vcl/source/window/winproc.cxx4
9 files changed, 68 insertions, 8 deletions
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index d8d350c5af2e..5c97ed39fe25 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -2325,11 +2325,40 @@ ScAnyRefModalDlg* ScModule::GetCurrentAnyRefDlg()
void ScModule::PushNewAnyRefDlg( ScAnyRefModalDlg* pNewDlg )
{
maAnyRefDlgStack.push( pNewDlg );
+
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+ while(pViewShell)
+ {
+ if ( pViewShell->ISA(ScTabViewShell) )
+ {
+ ScTabViewShell* pViewSh = (ScTabViewShell*)pViewShell;
+ pViewSh->SetInRefMode( true );
+ }
+ pViewShell = SfxViewShell::GetNext( *pViewShell );
+ }
}
void ScModule::PopAnyRefDlg()
{
maAnyRefDlgStack.pop();
+
+ if(maAnyRefDlgStack.empty())
+ {
+ // no modal ref dlg any more
+ // disable the flag in ScGridWindow
+
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+ while(pViewShell)
+ {
+ if ( pViewShell->ISA(ScTabViewShell) )
+ {
+ ScTabViewShell* pViewSh = (ScTabViewShell*)pViewShell;
+ pViewSh->SetInRefMode( false );
+ }
+ pViewShell = SfxViewShell::GetNext( *pViewShell );
+ }
+
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 8c5833a180aa..a6c9f7bef45b 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -372,6 +372,8 @@ public:
void UpdateDPFromFieldPopupMenu();
void UpdateVisibleRange();
+ void SetInRefMode( bool bRefMode );
+
// #114409#
void CursorChanged();
void DrawLayerCreated();
@@ -392,8 +394,6 @@ public:
void UpdateShrinkOverlay();
void UpdateAllOverlays();
- virtual bool IsInRefMode() const { return true; }
-
protected:
// #114409#
void ImpCreateOverlayObjects();
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 218c506b4fb5..ced5ea54b53d 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -527,6 +527,8 @@ public:
void SetBrushDocument( ScDocument* pNew, bool bLock );
void SetDrawBrushSet( SfxItemSet* pNew, bool bLock );
void ResetBrushDocument();
+
+ void SetInRefMode( bool bRefMode );
};
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 58fa2f8b6ff1..0e05389961d0 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5989,4 +5989,15 @@ void ScGridWindow::flushOverlayManager()
xOverlayManager->flush();
}
+void ScGridWindow::SetInRefMode( bool bInRefMode )
+{
+ WinBits nBits = GetStyle();
+ if(bInRefMode)
+ nBits |= WB_REFMODE;
+ else
+ nBits &= ~WB_REFMODE;
+
+ SetStyle( nBits );
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 6752ad29c1f6..487f5c8a1ebc 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2325,5 +2325,16 @@ void ScTabView::EnableRefInput(bool bFlag)
pRowBar[SC_SPLIT_TOP]->EnableInput(bFlag,false);
}
+void ScTabView::SetInRefMode( bool bRefMode )
+{
+ if(pGridWin[SC_SPLIT_BOTTOMLEFT])
+ pGridWin[SC_SPLIT_BOTTOMLEFT]->SetInRefMode( bRefMode );
+ if(pGridWin[SC_SPLIT_BOTTOMRIGHT])
+ pGridWin[SC_SPLIT_BOTTOMRIGHT]->SetInRefMode( bRefMode );
+ if(pGridWin[SC_SPLIT_TOPLEFT])
+ pGridWin[SC_SPLIT_TOPLEFT]->SetInRefMode( bRefMode );
+ if(pGridWin[SC_SPLIT_TOPRIGHT])
+ pGridWin[SC_SPLIT_TOPRIGHT]->SetInRefMode( bRefMode );
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx
index 60f9236a796b..acd1162ac4e3 100644
--- a/tools/inc/tools/wintypes.hxx
+++ b/tools/inc/tools/wintypes.hxx
@@ -172,6 +172,7 @@ typedef sal_Int64 WinBits;
#define WB_AUTOVSCROLL ((WinBits)SAL_CONST_INT64(0x40000000))
#define WB_HYPHENATION (((WinBits)SAL_CONST_INT64(0x800000000)) | WB_WORDBREAK)
#define WB_CHILDDLGCTRL ((WinBits)SAL_CONST_INT64(0x100000000000))
+#define WB_REFMODE ((WinBits)SAL_CONST_INT64(0x200000000000))
// system floating window
#define WB_SYSTEMFLOATWIN ((WinBits)SAL_CONST_INT64(0x100000000))
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 9ba556ce9507..6eabe159200b 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -811,7 +811,10 @@ public:
*/
sal_Bool IsInModalMode() const;
- virtual bool IsInRefMode() const;
+ /**
+ * Necessary for calc ref input handling from modal dialogs
+ */
+ bool IsInModalNonRefMode() const;
void SetActivateMode( sal_uInt16 nMode );
sal_uInt16 GetActivateMode() const;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index d1ea694eebcd..fd96248026f1 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3974,7 +3974,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
}
// If the Window is disabled, then we don't change the focus
- if ( !IsEnabled() || !IsInputEnabled() /*|| IsInModalMode()*/ )
+ if ( !IsEnabled() || !IsInputEnabled() || IsInModalNonRefMode() )
return;
// we only need to set the focus if it is not already set
@@ -9275,9 +9275,12 @@ sal_Bool Window::IsInModalMode() const
return (mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrameData->mnModalMode != 0);
}
-bool Window::IsInRefMode() const
+bool Window::IsInModalNonRefMode() const
{
- return false;
+ if(mpWindowImpl->mnStyle & WB_REFMODE)
+ return false;
+
+ return IsInModalMode();
}
void Window::ImplIncModalCount()
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index b3494a1cff8e..56fc9b15fdfd 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -238,7 +238,7 @@ static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos )
nHelpMode |= HELPMODE_BALLOON;
if ( nHelpMode )
{
- if ( pChild->IsInputEnabled() /*&& ! pChild->IsInModalMode() */)
+ if ( pChild->IsInputEnabled() && !pChild->IsInModalNonRefMode() )
{
HelpEvent aHelpEvent( rMousePos, nHelpMode );
pSVData->maHelpData.mbRequestingHelp = sal_True;
@@ -449,7 +449,7 @@ long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouse
// no mouse messages to disabled windows
// #106845# if the window was disabed during capturing we have to pass the mouse events to release capturing
- if ( pSVData->maWinData.mpCaptureWin != pChild && (!pChild->IsEnabled() || !pChild->IsInputEnabled() /*|| (pChild->IsInModalMode() && !pChild->IsInRefMode())*/ ) )
+ if ( pSVData->maWinData.mpCaptureWin != pChild && (!pChild->IsEnabled() || !pChild->IsInputEnabled() || pChild->IsInModalNonRefMode() ) )
{
ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave );
if ( nSVEvent == EVENT_MOUSEMOVE )