summaryrefslogtreecommitdiff
path: root/sd/source/ui/toolpanel
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2011-02-28 17:12:48 +0100
committerIvo Hinkelmann <ihi@openoffice.org>2011-02-28 17:12:48 +0100
commit973d2ca14b29d856023ea1c7b49e6bddd3ca2bc7 (patch)
treef0550da7abf84599799b5dab66f45cc8eee7ab21 /sd/source/ui/toolpanel
parenta0e99ecace0b744ae75c9f2fbcde9990a2b6faa4 (diff)
parent086ff12951769a2fadfc0f92f57c2e4f41108b72 (diff)
CWS-TOOLING: integrate CWS impress195
Diffstat (limited to 'sd/source/ui/toolpanel')
-rwxr-xr-x[-rw-r--r--]sd/source/ui/toolpanel/TaskPaneFocusManager.cxx19
-rwxr-xr-x[-rw-r--r--]sd/source/ui/toolpanel/TaskPaneFocusManager.hxx1
-rwxr-xr-xsd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx2
3 files changed, 14 insertions, 8 deletions
diff --git a/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx b/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
index 48882d0f2f9e..d1c5d2c0ff53 100644..100755
--- a/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
+++ b/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
@@ -31,9 +31,9 @@
#include "TaskPaneFocusManager.hxx"
#include <vcl/window.hxx>
-#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/event.hxx>
+#include <rtl/instance.hxx>
#include <hash_map>
namespace {
@@ -70,16 +70,23 @@ class FocusManager::LinkMap
-FocusManager* FocusManager::spInstance = NULL;
-
-
FocusManager& FocusManager::Instance (void)
{
+ static FocusManager* spInstance = NULL;
+
if (spInstance == NULL)
{
- ::vos::OGuard aGuard (::Application::GetSolarMutex());
+ ::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
if (spInstance == NULL)
- spInstance = new FocusManager ();
+ {
+ static FocusManager aInstance;
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+ spInstance = &aInstance;
+ }
+ }
+ else
+ {
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
}
return *spInstance;
}
diff --git a/sd/source/ui/toolpanel/TaskPaneFocusManager.hxx b/sd/source/ui/toolpanel/TaskPaneFocusManager.hxx
index b9b28154dc5b..0b5199a9a7cc 100644..100755
--- a/sd/source/ui/toolpanel/TaskPaneFocusManager.hxx
+++ b/sd/source/ui/toolpanel/TaskPaneFocusManager.hxx
@@ -103,7 +103,6 @@ public:
bool TransferFocus (::Window* pSource, const KeyCode& rCode);
private:
- static FocusManager* spInstance;
class LinkMap;
::std::auto_ptr<LinkMap> mpLinks;
diff --git a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
index 29018cb3a3ca..9b6e45c35194 100755
--- a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
@@ -227,7 +227,7 @@ void CurrentMasterPagesSelector::Execute (SfxRequest& rRequest)
// i.e. is not used.
SdPage* pMasterPage = GetSelectedMasterPage();
if (pMasterPage != NULL
- && mrDocument.GetMasterPageUserCount(pMasterPage) > 0)
+ && mrDocument.GetMasterPageUserCount(pMasterPage) == 0)
{
// Removing the precious flag so that the following call to
// RemoveUnnessesaryMasterPages() will remove this master page.