fix linking problem with gcc 4.7

f41
David Tardon 13 years ago
parent 53df3dd57b
commit c66ada513b

@ -0,0 +1,159 @@
From df97997452b443f184c07c8cb1eedaaa0621f05f Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Fri, 13 Jan 2012 07:53:08 +0100
Subject: [PATCH] refactor slightly to avoid link problems with gcc 4.7
---
sc/source/ui/inc/anyrefdg.hxx | 23 ++++++++---
sc/source/ui/miscdlgs/anyrefdg.cxx | 80 ++++++++++++++---------------------
2 files changed, 49 insertions(+), 54 deletions(-)
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 3dd531b..383f6b3 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -121,7 +121,6 @@ class SC_DLLPUBLIC ScRefHandler : //public SfxModelessDialog,
public:
operator Window *(){ return &m_rWindow; }
Window * operator ->() { return static_cast<Window *>(*this); }
- template<class,bool> friend class ScRefHdlrImplBase;
friend class formula::RefButton;
friend class formula::RefEdit;
@@ -152,6 +151,9 @@ protected:
bool ParseWithNames( ScRangeList& rRanges, const String& rStr, ScDocument* pDoc );
+ void preNotify(const NotifyEvent& rEvent, const bool bBindRef);
+ void stateChanged(const StateChangedType nStateChange, const bool bBindRef);
+
public:
ScRefHandler( Window &rWindow, SfxBindings* pB/*, SfxChildWindow* pCW,
Window* pParent, sal_uInt16 nResId*/, bool bBindRef );
@@ -222,6 +224,20 @@ ScRefHdlrImplBase<TWindow,bBindRef>::ScRefHdlrImplBase( TParentWindow* pParent,
template<class TWindow, bool bBindRef >
ScRefHdlrImplBase<TWindow,bBindRef>::~ScRefHdlrImplBase(){}
+template<class TWindow, bool bBindRef>
+long ScRefHdlrImplBase<TWindow, bBindRef>::PreNotify( NotifyEvent& rNEvt )
+{
+ ScRefHandler::preNotify( rNEvt, bBindRef );
+ return TWindow::PreNotify( rNEvt );
+}
+
+template<class TWindow, bool bBindRef>
+void ScRefHdlrImplBase<TWindow, bBindRef>::StateChanged( StateChangedType nStateChange )
+{
+ TWindow::StateChanged( nStateChange );
+ ScRefHandler::stateChanged( nStateChange, bBindRef );
+}
+
//============================================================================
template<class TDerived, class TBase, bool bBindRef = true>
struct ScRefHdlrImpl: ScRefHdlrImplBase<TBase, bBindRef >
@@ -257,11 +273,6 @@ inline bool ScRefHandler::CanInputDone( sal_Bool bForced )
return m_aHelper.CanInputDone( bForced );
}
-template <> SC_DLLPUBLIC void ScRefHdlrImplBase<SfxModelessDialog,true>::StateChanged( StateChangedType nStateChange );
-template <> SC_DLLPUBLIC long ScRefHdlrImplBase<SfxModelessDialog,true>::PreNotify( NotifyEvent& rNEvt );
-template <> SC_DLLPUBLIC void ScRefHdlrImplBase<SfxTabDialog,false>::StateChanged( StateChangedType nStateChange );
-template <> SC_DLLPUBLIC long ScRefHdlrImplBase<SfxTabDialog,false>::PreNotify( NotifyEvent& rNEvt );
-
#endif // SC_ANYREFDG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 91e3858..b0a4ad6 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -865,54 +865,38 @@ void ScRefHandler::ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton*
m_aHelper.ToggleCollapsed( pEdit, pButton );
}
-#if defined( _MSC_VER )
-#define INTRODUCE_TEMPLATE
-#else
-#define INTRODUCE_TEMPLATE template <>
-#endif
-
-#define IMPL_TWINDOW_PRENOTIFY( TWindow,bBindRef ) \
-INTRODUCE_TEMPLATE long ScRefHdlrImplBase<TWindow,bBindRef>::PreNotify( NotifyEvent& rNEvt )\
-{\
- if( bBindRef || m_bInRefMode )\
- {\
- sal_uInt16 nSwitch=rNEvt.GetType();\
- if(nSwitch==EVENT_GETFOCUS)\
- {\
- pActiveWin=rNEvt.GetWindow();\
- }\
- }\
- return TWindow::PreNotify(rNEvt);\
-}
-
-#define IMPL_TWINDOW_STATECHANGED( TWindow,bBindRef ) \
-INTRODUCE_TEMPLATE void ScRefHdlrImplBase<TWindow,bBindRef>::StateChanged( StateChangedType nStateChange )\
-{\
- TWindow::StateChanged( nStateChange );\
-\
- if( !bBindRef && !m_bInRefMode ) return;\
- \
- if(nStateChange == STATE_CHANGE_VISIBLE)\
- {\
- if(m_rWindow.IsVisible())\
- {\
- m_aHelper.enableInput( false );\
- m_aHelper.EnableSpreadsheets();\
- m_aHelper.SetDispatcherLock( sal_True );\
- aTimer.Start();\
- }\
- else\
- {\
- m_aHelper.enableInput( sal_True );\
- m_aHelper.SetDispatcherLock( false ); /*//! here and in DoClose ?*/\
- }\
- }\
-}
-
-IMPL_TWINDOW_PRENOTIFY( SfxModelessDialog, true )
-IMPL_TWINDOW_PRENOTIFY( SfxTabDialog, false )
-IMPL_TWINDOW_STATECHANGED( SfxModelessDialog, true )
-IMPL_TWINDOW_STATECHANGED( SfxTabDialog, false )
+void ScRefHandler::preNotify(const NotifyEvent& rNEvt, const bool bBindRef)
+{
+ if( bBindRef || m_bInRefMode )
+ {
+ sal_uInt16 nSwitch=rNEvt.GetType();
+ if(nSwitch==EVENT_GETFOCUS)
+ {
+ pActiveWin=rNEvt.GetWindow();
+ }
+ }
+}
+
+void ScRefHandler::stateChanged(const StateChangedType nStateChange, const bool bBindRef)
+{
+ if( !bBindRef && !m_bInRefMode ) return;
+
+ if(nStateChange == STATE_CHANGE_VISIBLE)
+ {
+ if(m_rWindow.IsVisible())
+ {
+ m_aHelper.enableInput( false );
+ m_aHelper.EnableSpreadsheets();
+ m_aHelper.SetDispatcherLock( sal_True );
+ aTimer.Start();
+ }
+ else
+ {
+ m_aHelper.enableInput( sal_True );
+ m_aHelper.SetDispatcherLock( false ); /*//! here and in DoClose ?*/
+ }
+ }
+}
IMPL_LINK( ScRefHandler, UpdateFocusHdl, Timer*, EMPTYARG )
{
--
1.7.7.5

@ -124,6 +124,7 @@ Patch19: 0001-fix-for-gcc-4.7-C-11-these-are-not-string-literal-op.patch
Patch20: 0001-fix-for-gcc-4.7-C-11-this-is-not-string-literal-oper.patch
Patch21: 0001-Revert-fast_merge-fix-mis-merge-of-first-module-s-st.patch
Patch22: 0001-fix-writing-of-strings-from-the-first-module.patch
Patch23: 0001-refactor-slightly-to-avoid-link-problems-with-gcc-4..patch
# TODO: this in S390 only, so it can wait .-)
#Patch13: solenv.fix.mk.inheritance.patch
@ -792,6 +793,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch20 -p1 -b .fix-for-gcc-4.7-C-11-this-is-not-string-literal-oper.patch
%patch21 -p1 -b .Revert-fast_merge-fix-mis-merge-of-first-module-s-st.patch
%patch22 -p1 -b .fix-writing-of-strings-from-the-first-module.patch
%patch23 -p1 -b .refactor-slightly-to-avoid-link-problems-with-gcc-4..patch
#%patch13 -p1 -b .solenv.fix.mk.inheritance.patch
# TODO: check this

Loading…
Cancel
Save