summaryrefslogtreecommitdiff
path: root/tubes/source
diff options
context:
space:
mode:
Diffstat (limited to 'tubes/source')
-rw-r--r--tubes/source/contacts.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/tubes/source/contacts.cxx b/tubes/source/contacts.cxx
index 540e8a6f4725..9245b55284b4 100644
--- a/tubes/source/contacts.cxx
+++ b/tubes/source/contacts.cxx
@@ -42,10 +42,13 @@
#include <vcl/dialog.hxx>
#include <vcl/unohelp.hxx>
+#include <map>
#include <vector>
#include <boost/ptr_container/ptr_vector.hpp>
#include <telepathy-glib/telepathy-glib.h>
+namespace {
+
ResId TubesResId( sal_uInt32 nId )
{
static ResMgr* pResMgr = NULL;
@@ -56,7 +59,6 @@ ResId TubesResId( sal_uInt32 nId )
return ResId( nId, *pResMgr );
}
-namespace {
class TubeContacts : public ModelessDialog
{
FixedLine maLabel;
@@ -261,12 +263,22 @@ IMPL_LINK_NOARG( TubeContacts, BtnListenHdl )
return 0;
}
+TubeContacts* ContactsFactory( Collaboration* pCollaboration )
+{
+ // Mapping contacts dialog instance for each document
+ static std::map< sal_uInt64, TubeContacts* > aDialogsMap;
+ sal_uInt64 Id = pCollaboration->GetId();
+ if (aDialogsMap.find( Id ) == aDialogsMap.end())
+ aDialogsMap[ Id ] = new TubeContacts( pCollaboration );
+ return aDialogsMap[ Id ];
+}
+
} // anonymous namespace
namespace tubes {
void createContacts( Collaboration* pCollaboration )
{
- static TubeContacts *pContacts = new TubeContacts( pCollaboration );
+ TubeContacts* pContacts = ContactsFactory( pCollaboration );
pContacts->Populate();
}
}