Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
c6fae31e
Kaydet (Commit)
c6fae31e
authored
Şub 02, 2013
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: replace SwEventListenerContainer in SwXTextField,SwXFieldMaster
Change-Id: I554ca3455ebddf6a4595175e8d71ae38b8b43e59
üst
080dc03a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
30 deletions
+71
-30
unofield.hxx
sw/source/core/inc/unofield.hxx
+11
-3
unofield.cxx
sw/source/core/unocore/unofield.cxx
+60
-27
No files found.
sw/source/core/inc/unofield.hxx
Dosyayı görüntüle @
c6fae31e
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
#include <tools/string.hxx>
#include <tools/string.hxx>
#include <calbck.hxx>
#include <calbck.hxx>
#include <uno
evtlstnr
.hxx>
#include <uno
baseclass
.hxx>
class
SwFieldType
;
class
SwFieldType
;
...
@@ -52,7 +52,11 @@ class SwXFieldMaster : public cppu::WeakImplHelper4
...
@@ -52,7 +52,11 @@ class SwXFieldMaster : public cppu::WeakImplHelper4
>
,
>
,
public
SwClient
public
SwClient
{
{
SwEventListenerContainer
aLstnrCntnr
;
private
:
class
Impl
;
::
sw
::
UnoImplPtr
<
Impl
>
m_pImpl
;
sal_uInt16
nResTypeId
;
sal_uInt16
nResTypeId
;
SwDoc
*
m_pDoc
;
SwDoc
*
m_pDoc
;
...
@@ -126,7 +130,11 @@ class SwXTextField : public cppu::WeakImplHelper5
...
@@ -126,7 +130,11 @@ class SwXTextField : public cppu::WeakImplHelper5
>
,
>
,
public
SwClient
public
SwClient
{
{
SwEventListenerContainer
aLstnrCntnr
;
private
:
class
Impl
;
::
sw
::
UnoImplPtr
<
Impl
>
m_pImpl
;
const
SwFmtFld
*
pFmtFld
;
const
SwFmtFld
*
pFmtFld
;
SwDoc
*
m_pDoc
;
SwDoc
*
m_pDoc
;
SwTextAPIObject
*
m_pTextObject
;
SwTextAPIObject
*
m_pTextObject
;
...
...
sw/source/core/unocore/unofield.cxx
Dosyayı görüntüle @
c6fae31e
...
@@ -386,6 +386,18 @@ static sal_uInt16 lcl_GetPropertyMapOfService( sal_uInt16 nServiceId )
...
@@ -386,6 +386,18 @@ static sal_uInt16 lcl_GetPropertyMapOfService( sal_uInt16 nServiceId )
/******************************************************************
/******************************************************************
* SwXFieldMaster
* SwXFieldMaster
******************************************************************/
******************************************************************/
class
SwXFieldMaster
::
Impl
{
private
:
::
osl
::
Mutex
m_Mutex
;
// just for OInterfaceContainerHelper
public
:
::
cppu
::
OInterfaceContainerHelper
m_EventListeners
;
Impl
()
:
m_EventListeners
(
m_Mutex
)
{
}
};
TYPEINIT1
(
SwXFieldMaster
,
SwClient
);
TYPEINIT1
(
SwXFieldMaster
,
SwClient
);
namespace
namespace
...
@@ -469,8 +481,9 @@ uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw(
...
@@ -469,8 +481,9 @@ uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw(
return
aRet
;
return
aRet
;
}
}
SwXFieldMaster
::
SwXFieldMaster
(
SwDoc
*
pDoc
,
sal_uInt16
nResId
)
:
SwXFieldMaster
::
SwXFieldMaster
(
SwDoc
*
pDoc
,
sal_uInt16
nResId
)
aLstnrCntnr
(
(
XPropertySet
*
)
this
),
:
m_pImpl
(
new
Impl
)
,
nResTypeId
(
nResId
),
nResTypeId
(
nResId
),
m_pDoc
(
pDoc
),
m_pDoc
(
pDoc
),
m_bIsDescriptor
(
sal_True
),
m_bIsDescriptor
(
sal_True
),
...
@@ -482,9 +495,10 @@ SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) :
...
@@ -482,9 +495,10 @@ SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) :
pDoc
->
GetPageDescFromPool
(
RES_POOLPAGE_STANDARD
)
->
Add
(
this
);
pDoc
->
GetPageDescFromPool
(
RES_POOLPAGE_STANDARD
)
->
Add
(
this
);
}
}
SwXFieldMaster
::
SwXFieldMaster
(
SwFieldType
&
rType
,
SwDoc
*
pDoc
)
:
SwXFieldMaster
::
SwXFieldMaster
(
SwFieldType
&
rType
,
SwDoc
*
pDoc
)
SwClient
(
&
rType
),
:
SwClient
(
&
rType
)
aLstnrCntnr
(
(
XPropertySet
*
)
this
),
,
m_pImpl
(
new
Impl
)
,
nResTypeId
(
rType
.
Which
()),
nResTypeId
(
rType
.
Which
()),
m_pDoc
(
pDoc
),
m_pDoc
(
pDoc
),
m_bIsDescriptor
(
sal_False
),
m_bIsDescriptor
(
sal_False
),
...
@@ -932,19 +946,20 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
...
@@ -932,19 +946,20 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
throw
uno
::
RuntimeException
();
throw
uno
::
RuntimeException
();
}
}
void
SwXFieldMaster
::
addEventListener
(
const
uno
::
Reference
<
lang
::
XEventListener
>
&
aListener
)
void
SAL_CALL
SwXFieldMaster
::
addEventListener
(
throw
(
uno
::
RuntimeException
)
const
uno
::
Reference
<
lang
::
XEventListener
>
&
xListener
)
throw
(
uno
::
RuntimeException
)
{
{
if
(
!
GetRegisteredIn
())
// no need to lock here as m_pImpl is const and container threadsafe
throw
uno
::
RuntimeException
();
m_pImpl
->
m_EventListeners
.
addInterface
(
xListener
);
aLstnrCntnr
.
AddListener
(
aListener
);
}
}
void
SwXFieldMaster
::
removeEventListener
(
const
uno
::
Reference
<
lang
::
XEventListener
>
&
aListener
)
void
SAL_CALL
SwXFieldMaster
::
removeEventListener
(
throw
(
uno
::
RuntimeException
)
const
uno
::
Reference
<
lang
::
XEventListener
>
&
xListener
)
throw
(
uno
::
RuntimeException
)
{
{
if
(
!
GetRegisteredIn
()
||
!
aLstnrCntnr
.
RemoveListener
(
aListener
))
// no need to lock here as m_pImpl is const and container threadsafe
throw
uno
::
RuntimeException
(
);
m_pImpl
->
m_EventListeners
.
removeInterface
(
xListener
);
}
}
void
SwXFieldMaster
::
Modify
(
const
SfxPoolItem
*
pOld
,
const
SfxPoolItem
*
pNew
)
void
SwXFieldMaster
::
Modify
(
const
SfxPoolItem
*
pOld
,
const
SfxPoolItem
*
pNew
)
...
@@ -952,8 +967,9 @@ void SwXFieldMaster::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
...
@@ -952,8 +967,9 @@ void SwXFieldMaster::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
ClientModify
(
this
,
pOld
,
pNew
);
ClientModify
(
this
,
pOld
,
pNew
);
if
(
!
GetRegisteredIn
())
if
(
!
GetRegisteredIn
())
{
{
aLstnrCntnr
.
Disposing
();
m_pDoc
=
0
;
m_pDoc
=
0
;
lang
::
EventObject
const
ev
(
static_cast
<
::
cppu
::
OWeakObject
&>
(
*
this
));
m_pImpl
->
m_EventListeners
.
disposeAndClear
(
ev
);
}
}
}
}
OUString
SwXFieldMaster
::
GetProgrammaticName
(
const
SwFieldType
&
rType
,
SwDoc
&
rDoc
)
OUString
SwXFieldMaster
::
GetProgrammaticName
(
const
SwFieldType
&
rType
,
SwDoc
&
rDoc
)
...
@@ -1064,6 +1080,17 @@ struct SwFieldProperties_Impl
...
@@ -1064,6 +1080,17 @@ struct SwFieldProperties_Impl
};
};
class
SwXTextField
::
Impl
{
private
:
::
osl
::
Mutex
m_Mutex
;
// just for OInterfaceContainerHelper
public
:
::
cppu
::
OInterfaceContainerHelper
m_EventListeners
;
Impl
()
:
m_EventListeners
(
m_Mutex
)
{
}
};
TYPEINIT1
(
SwXTextField
,
SwClient
);
TYPEINIT1
(
SwXTextField
,
SwClient
);
namespace
namespace
...
@@ -1088,8 +1115,9 @@ sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >&
...
@@ -1088,8 +1115,9 @@ sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >&
return
0
;
return
0
;
}
}
SwXTextField
::
SwXTextField
(
sal_uInt16
nServiceId
,
SwDoc
*
pDoc
)
:
SwXTextField
::
SwXTextField
(
sal_uInt16
nServiceId
,
SwDoc
*
pDoc
)
aLstnrCntnr
(
(
XTextContent
*
)
this
),
:
m_pImpl
(
new
Impl
)
,
pFmtFld
(
0
),
pFmtFld
(
0
),
m_pDoc
(
pDoc
),
m_pDoc
(
pDoc
),
m_pTextObject
(
0
),
m_pTextObject
(
0
),
...
@@ -1111,8 +1139,9 @@ SwXTextField::SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc) :
...
@@ -1111,8 +1139,9 @@ SwXTextField::SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc) :
}
}
SwXTextField
::
SwXTextField
(
const
SwFmtFld
&
rFmt
,
SwDoc
*
pDc
)
:
SwXTextField
::
SwXTextField
(
const
SwFmtFld
&
rFmt
,
SwDoc
*
pDc
)
aLstnrCntnr
(
(
XTextContent
*
)
this
),
:
m_pImpl
(
new
Impl
)
,
pFmtFld
(
&
rFmt
),
pFmtFld
(
&
rFmt
),
m_pDoc
(
pDc
),
m_pDoc
(
pDc
),
m_pTextObject
(
0
),
m_pTextObject
(
0
),
...
@@ -1843,17 +1872,20 @@ void SwXTextField::dispose(void) throw( uno::RuntimeException )
...
@@ -1843,17 +1872,20 @@ void SwXTextField::dispose(void) throw( uno::RuntimeException )
}
}
}
}
void
SwXTextField
::
addEventListener
(
const
uno
::
Reference
<
lang
::
XEventListener
>
&
aListener
)
throw
(
uno
::
RuntimeException
)
void
SAL_CALL
SwXTextField
::
addEventListener
(
const
uno
::
Reference
<
lang
::
XEventListener
>
&
xListener
)
throw
(
uno
::
RuntimeException
)
{
{
if
(
!
GetRegisteredIn
())
// no need to lock here as m_pImpl is const and container threadsafe
throw
uno
::
RuntimeException
();
m_pImpl
->
m_EventListeners
.
addInterface
(
xListener
);
aLstnrCntnr
.
AddListener
(
aListener
);
}
}
void
SwXTextField
::
removeEventListener
(
const
uno
::
Reference
<
lang
::
XEventListener
>
&
aListener
)
throw
(
uno
::
RuntimeException
)
void
SAL_CALL
SwXTextField
::
removeEventListener
(
const
uno
::
Reference
<
lang
::
XEventListener
>
&
xListener
)
throw
(
uno
::
RuntimeException
)
{
{
if
(
!
GetRegisteredIn
()
||
!
aLstnrCntnr
.
RemoveListener
(
aListener
))
// no need to lock here as m_pImpl is const and container threadsafe
throw
uno
::
RuntimeException
(
);
m_pImpl
->
m_EventListeners
.
removeInterface
(
xListener
);
}
}
uno
::
Reference
<
beans
::
XPropertySetInfo
>
SwXTextField
::
getPropertySetInfo
(
void
)
uno
::
Reference
<
beans
::
XPropertySetInfo
>
SwXTextField
::
getPropertySetInfo
(
void
)
...
@@ -2351,9 +2383,10 @@ void SwXTextField::Invalidate()
...
@@ -2351,9 +2383,10 @@ void SwXTextField::Invalidate()
if
(
GetRegisteredIn
())
if
(
GetRegisteredIn
())
{
{
((
SwModify
*
)
GetRegisteredIn
())
->
Remove
(
this
);
((
SwModify
*
)
GetRegisteredIn
())
->
Remove
(
this
);
aLstnrCntnr
.
Disposing
();
pFmtFld
=
0
;
pFmtFld
=
0
;
m_pDoc
=
0
;
m_pDoc
=
0
;
lang
::
EventObject
const
ev
(
static_cast
<
::
cppu
::
OWeakObject
&>
(
*
this
));
m_pImpl
->
m_EventListeners
.
disposeAndClear
(
ev
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment