diff --git a/mozilla/editor/base/nsEditor.cpp b/mozilla/editor/base/nsEditor.cpp index 78004932d54..49397ec3297 100644 --- a/mozilla/editor/base/nsEditor.cpp +++ b/mozilla/editor/base/nsEditor.cpp @@ -787,6 +787,8 @@ NS_IMETHODIMP nsEditor::Cut() return res; } +extern "C" NS_EXPORT nsISelectionMgr* GetSelectionMgr(); + NS_IMETHODIMP nsEditor::Copy() { //printf("nsEditor::Copy\n"); @@ -797,13 +799,7 @@ NS_IMETHODIMP nsEditor::Copy() // See http://bugzilla.mozilla.org/show_bug.cgi?id=3509. // In the meantime, so I'm not blocked on writing the rest of the code, // nsSelectionMgr uses the egregious hack of a global variable: -#define EXTERNAL_SELECTION_MGR 1 -#ifdef EXTERNAL_SELECTION_MGR - extern nsISelectionMgr* theSelectionMgr; - nsISelectionMgr* selectionMgr = theSelectionMgr; -#else /* EXTERNAL_SELECTION_MGR */ - nsISelectionMgr* selectionMgr = 0; -#endif /* EXTERNAL_SELECTION_MGR */ + nsISelectionMgr* selectionMgr = GetSelectionMgr(); if (!selectionMgr) { printf("Can't get selection mgr!\n"); @@ -824,12 +820,7 @@ NS_IMETHODIMP nsEditor::Paste() // See http://bugzilla.mozilla.org/show_bug.cgi?id=3509. // In the meantime, so I'm not blocked on writing the rest of the code, // nsSelectionMgr uses the egregious hack of a global variable: -#ifdef EXTERNAL_SELECTION_MGR - extern nsISelectionMgr* theSelectionMgr; - nsISelectionMgr* selectionMgr = theSelectionMgr; -#else /* EXTERNAL_SELECTION_MGR */ - nsISelectionMgr* selectionMgr = 0; -#endif /* EXTERNAL_SELECTION_MGR */ + nsISelectionMgr* selectionMgr = GetSelectionMgr(); if (!selectionMgr) { printf("Can't get selection mgr!\n"); diff --git a/mozilla/editor/libeditor/base/nsEditor.cpp b/mozilla/editor/libeditor/base/nsEditor.cpp index 78004932d54..49397ec3297 100644 --- a/mozilla/editor/libeditor/base/nsEditor.cpp +++ b/mozilla/editor/libeditor/base/nsEditor.cpp @@ -787,6 +787,8 @@ NS_IMETHODIMP nsEditor::Cut() return res; } +extern "C" NS_EXPORT nsISelectionMgr* GetSelectionMgr(); + NS_IMETHODIMP nsEditor::Copy() { //printf("nsEditor::Copy\n"); @@ -797,13 +799,7 @@ NS_IMETHODIMP nsEditor::Copy() // See http://bugzilla.mozilla.org/show_bug.cgi?id=3509. // In the meantime, so I'm not blocked on writing the rest of the code, // nsSelectionMgr uses the egregious hack of a global variable: -#define EXTERNAL_SELECTION_MGR 1 -#ifdef EXTERNAL_SELECTION_MGR - extern nsISelectionMgr* theSelectionMgr; - nsISelectionMgr* selectionMgr = theSelectionMgr; -#else /* EXTERNAL_SELECTION_MGR */ - nsISelectionMgr* selectionMgr = 0; -#endif /* EXTERNAL_SELECTION_MGR */ + nsISelectionMgr* selectionMgr = GetSelectionMgr(); if (!selectionMgr) { printf("Can't get selection mgr!\n"); @@ -824,12 +820,7 @@ NS_IMETHODIMP nsEditor::Paste() // See http://bugzilla.mozilla.org/show_bug.cgi?id=3509. // In the meantime, so I'm not blocked on writing the rest of the code, // nsSelectionMgr uses the egregious hack of a global variable: -#ifdef EXTERNAL_SELECTION_MGR - extern nsISelectionMgr* theSelectionMgr; - nsISelectionMgr* selectionMgr = theSelectionMgr; -#else /* EXTERNAL_SELECTION_MGR */ - nsISelectionMgr* selectionMgr = 0; -#endif /* EXTERNAL_SELECTION_MGR */ + nsISelectionMgr* selectionMgr = GetSelectionMgr(); if (!selectionMgr) { printf("Can't get selection mgr!\n"); diff --git a/mozilla/widget/src/gtk/nsSelectionMgr.cpp b/mozilla/widget/src/gtk/nsSelectionMgr.cpp index 107980a38d3..0b0ec21fd8d 100644 --- a/mozilla/widget/src/gtk/nsSelectionMgr.cpp +++ b/mozilla/widget/src/gtk/nsSelectionMgr.cpp @@ -74,6 +74,12 @@ // has a way of registering instances // (see http://bugzilla.mozilla.org/show_bug.cgi?id=3509 ). nsISelectionMgr* theSelectionMgr = 0; + +extern "C" NS_EXPORT nsISelectionMgr* +GetSelectionMgr() +{ + return theSelectionMgr; +} // BWEEP BWEEP // diff --git a/mozilla/widget/src/mac/nsSelectionMgr.cpp b/mozilla/widget/src/mac/nsSelectionMgr.cpp index 31ecef57025..030cdd7d1aa 100644 --- a/mozilla/widget/src/mac/nsSelectionMgr.cpp +++ b/mozilla/widget/src/mac/nsSelectionMgr.cpp @@ -31,6 +31,12 @@ NS_IMPL_RELEASE(nsSelectionMgr) // has a way of registering instances // (see http://bugzilla.mozilla.org/show_bug.cgi?id=3509 ). nsISelectionMgr* theSelectionMgr = 0; + +extern "C" NS_EXPORT nsISelectionMgr* +GetSelectionMgr() +{ + return theSelectionMgr; +} // BWEEP BWEEP nsSelectionMgr::nsSelectionMgr() diff --git a/mozilla/widget/src/windows/nsSelectionMgr.cpp b/mozilla/widget/src/windows/nsSelectionMgr.cpp index 177bc4416f6..73a044073fc 100644 --- a/mozilla/widget/src/windows/nsSelectionMgr.cpp +++ b/mozilla/widget/src/windows/nsSelectionMgr.cpp @@ -26,6 +26,12 @@ // has a way of registering instances // (see http://bugzilla.mozilla.org/show_bug.cgi?id=3509 ). nsISelectionMgr* theSelectionMgr = 0; + +extern "C" NS_EXPORT nsISelectionMgr* +GetSelectionMgr() +{ + return theSelectionMgr; +} // BWEEP BWEEP /**