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
503b6366
Kaydet (Commit)
503b6366
authored
Şub 02, 2013
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: remove class SwChartEventListenerContainer
Change-Id: Ieb1efc28c65e7f191d61beb7f8541564f4fd3e43
üst
750a14f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
75 deletions
+69
-75
unotbl.hxx
sw/inc/unotbl.hxx
+5
-10
unotbl.cxx
sw/source/core/unocore/unotbl.cxx
+64
-65
No files found.
sw/inc/unotbl.hxx
Dosyayı görüntüle @
503b6366
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/implbase7.hxx>
#include <cppuhelper/implbase7.hxx>
#include <cppuhelper/implbase10.hxx>
#include <cppuhelper/implbase10.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <comphelper/uno3.hxx>
#include <comphelper/uno3.hxx>
#include <tools/string.hxx>
#include <tools/string.hxx>
...
@@ -57,14 +58,6 @@ class SwChartDataProvider;
...
@@ -57,14 +58,6 @@ class SwChartDataProvider;
class
SwFrmFmt
;
class
SwFrmFmt
;
class
SwChartEventListenerContainer
:
public
SwEventListenerContainer
{
public
:
SwChartEventListenerContainer
(
::
com
::
sun
::
star
::
uno
::
XInterface
*
pxParentL
)
:
SwEventListenerContainer
(
pxParentL
){}
void
ChartDataChanged
();
};
typedef
typedef
cppu
::
WeakImplHelper4
cppu
::
WeakImplHelper4
<
<
...
@@ -296,8 +289,9 @@ class SwXTextTable : public cppu::WeakImplHelper10
...
@@ -296,8 +289,9 @@ class SwXTextTable : public cppu::WeakImplHelper10
>
,
>
,
public
SwClient
public
SwClient
{
{
::
osl
::
Mutex
m_Mutex
;
::
cppu
::
OInterfaceContainerHelper
m_ChartListeners
;
SwEventListenerContainer
aLstnrCntnr
;
SwEventListenerContainer
aLstnrCntnr
;
SwChartEventListenerContainer
aChartLstnrCntnr
;
const
SfxItemPropertySet
*
m_pPropSet
;
const
SfxItemPropertySet
*
m_pPropSet
;
// Descriptor-interface
// Descriptor-interface
...
@@ -416,7 +410,8 @@ class SwXCellRange : public cppu::WeakImplHelper7
...
@@ -416,7 +410,8 @@ class SwXCellRange : public cppu::WeakImplHelper7
public
SwClient
public
SwClient
{
{
SwDepend
aCursorDepend
;
//the cursor is removed after the doc has been removed
SwDepend
aCursorDepend
;
//the cursor is removed after the doc has been removed
SwChartEventListenerContainer
aChartLstnrCntnr
;
::
osl
::
Mutex
m_Mutex
;
::
cppu
::
OInterfaceContainerHelper
m_ChartListeners
;
SwRangeDescriptor
aRgDesc
;
SwRangeDescriptor
aRgDesc
;
const
SfxItemPropertySet
*
m_pPropSet
;
const
SfxItemPropertySet
*
m_pPropSet
;
...
...
sw/source/core/unocore/unotbl.cxx
Dosyayı görüntüle @
503b6366
...
@@ -106,6 +106,22 @@ extern void sw_GetTblBoxColStr( sal_uInt16 nCol, String& rNm );
...
@@ -106,6 +106,22 @@ extern void sw_GetTblBoxColStr( sal_uInt16 nCol, String& rNm );
#define UNO_TABLE_COLUMN_SUM 10000
#define UNO_TABLE_COLUMN_SUM 10000
static
void
lcl_SendChartEvent
(
::
cppu
::
OWeakObject
&
rSource
,
::
cppu
::
OInterfaceContainerHelper
&
rListeners
)
{
//TODO: find appropriate settings of the Event
chart
::
ChartDataChangeEvent
event
;
event
.
Source
=
&
rSource
;
event
.
Type
=
chart
::
ChartDataChangeType_ALL
;
event
.
StartColumn
=
0
;
event
.
EndColumn
=
1
;
event
.
StartRow
=
0
;
event
.
EndRow
=
1
;
rListeners
.
notifyEach
(
&
chart
::
XChartDataChangeEventListener
::
chartDataChanged
,
event
);
}
static
bool
lcl_LineToSvxLine
(
const
table
::
BorderLine
&
rLine
,
SvxBorderLine
&
rSvxLine
)
static
bool
lcl_LineToSvxLine
(
const
table
::
BorderLine
&
rLine
,
SvxBorderLine
&
rSvxLine
)
{
{
rSvxLine
.
SetColor
(
Color
(
rLine
.
Color
));
rSvxLine
.
SetColor
(
Color
(
rLine
.
Color
));
...
@@ -2112,9 +2128,10 @@ sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >&
...
@@ -2112,9 +2128,10 @@ sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >&
TYPEINIT1
(
SwXTextTable
,
SwClient
)
TYPEINIT1
(
SwXTextTable
,
SwClient
)
SwXTextTable
::
SwXTextTable
()
:
SwXTextTable
::
SwXTextTable
()
:
m_ChartListeners
(
m_Mutex
)
,
aLstnrCntnr
(
(
text
::
XTextTable
*
)
this
),
aLstnrCntnr
(
(
text
::
XTextTable
*
)
this
),
aChartLstnrCntnr
(
(
text
::
XTextTable
*
)
this
),
m_pPropSet
(
aSwMapProvider
.
GetPropertySet
(
PROPERTY_MAP_TEXT_TABLE
)),
m_pPropSet
(
aSwMapProvider
.
GetPropertySet
(
PROPERTY_MAP_TEXT_TABLE
)),
pTableProps
(
new
SwTableProperties_Impl
),
pTableProps
(
new
SwTableProperties_Impl
),
bIsDescriptor
(
sal_True
),
bIsDescriptor
(
sal_True
),
...
@@ -2125,10 +2142,11 @@ SwXTextTable::SwXTextTable() :
...
@@ -2125,10 +2142,11 @@ SwXTextTable::SwXTextTable() :
{
{
}
}
SwXTextTable
::
SwXTextTable
(
SwFrmFmt
&
rFrmFmt
)
:
SwXTextTable
::
SwXTextTable
(
SwFrmFmt
&
rFrmFmt
)
SwClient
(
&
rFrmFmt
),
:
SwClient
(
&
rFrmFmt
)
,
m_ChartListeners
(
m_Mutex
)
,
aLstnrCntnr
(
(
text
::
XTextTable
*
)
this
),
aLstnrCntnr
(
(
text
::
XTextTable
*
)
this
),
aChartLstnrCntnr
(
(
text
::
XTextTable
*
)
this
),
m_pPropSet
(
aSwMapProvider
.
GetPropertySet
(
PROPERTY_MAP_TEXT_TABLE
)),
m_pPropSet
(
aSwMapProvider
.
GetPropertySet
(
PROPERTY_MAP_TEXT_TABLE
)),
pTableProps
(
0
),
pTableProps
(
0
),
bIsDescriptor
(
sal_False
),
bIsDescriptor
(
sal_False
),
...
@@ -2719,7 +2737,9 @@ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData
...
@@ -2719,7 +2737,9 @@ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData
}
}
}
}
if
(
bChanged
)
if
(
bChanged
)
aChartLstnrCntnr
.
ChartDataChanged
();
{
lcl_SendChartEvent
(
*
this
,
m_ChartListeners
);
}
}
}
}
}
...
@@ -2876,21 +2896,20 @@ void SwXTextTable::setColumnDescriptions(const uno::Sequence< OUString >& rColum
...
@@ -2876,21 +2896,20 @@ void SwXTextTable::setColumnDescriptions(const uno::Sequence< OUString >& rColum
throw
uno
::
RuntimeException
();
throw
uno
::
RuntimeException
();
}
}
void
SwXTextTable
::
addChartDataChangeEventListener
(
void
S
AL_CALL
S
wXTextTable
::
addChartDataChangeEventListener
(
const
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
&
a
Listener
)
const
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
&
x
Listener
)
throw
(
uno
::
RuntimeException
)
throw
(
uno
::
RuntimeException
)
{
{
if
(
!
GetRegisteredIn
())
// no need to lock here as m_pImpl is const and container threadsafe
throw
uno
::
RuntimeException
();
m_ChartListeners
.
addInterface
(
xListener
);
aChartLstnrCntnr
.
AddListener
(
aListener
.
get
());
}
}
void
SwXTextTable
::
removeChartDataChangeEventListener
(
void
S
AL_CALL
S
wXTextTable
::
removeChartDataChangeEventListener
(
const
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
&
a
Listener
)
const
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
&
x
Listener
)
throw
(
uno
::
RuntimeException
)
throw
(
uno
::
RuntimeException
)
{
{
if
(
!
GetRegisteredIn
()
||
!
aChartLstnrCntnr
.
RemoveListener
(
aListener
.
get
()))
// no need to lock here as m_pImpl is const and container threadsafe
throw
uno
::
RuntimeException
(
);
m_ChartListeners
.
removeInterface
(
xListener
);
}
}
sal_Bool
SwXTextTable
::
isNotANumber
(
double
nNumber
)
throw
(
uno
::
RuntimeException
)
sal_Bool
SwXTextTable
::
isNotANumber
(
double
nNumber
)
throw
(
uno
::
RuntimeException
)
...
@@ -3014,7 +3033,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
...
@@ -3014,7 +3033,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
sal_Bool
bTmp
=
*
(
sal_Bool
*
)
aValue
.
getValue
();
sal_Bool
bTmp
=
*
(
sal_Bool
*
)
aValue
.
getValue
();
if
(
bFirstRowAsLabel
!=
bTmp
)
if
(
bFirstRowAsLabel
!=
bTmp
)
{
{
aChartLstnrCntnr
.
ChartDataChanged
(
);
lcl_SendChartEvent
(
*
this
,
m_ChartListeners
);
bFirstRowAsLabel
=
bTmp
;
bFirstRowAsLabel
=
bTmp
;
}
}
}
}
...
@@ -3024,7 +3043,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
...
@@ -3024,7 +3043,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
sal_Bool
bTmp
=
*
(
sal_Bool
*
)
aValue
.
getValue
();
sal_Bool
bTmp
=
*
(
sal_Bool
*
)
aValue
.
getValue
();
if
(
bFirstColumnAsLabel
!=
bTmp
)
if
(
bFirstColumnAsLabel
!=
bTmp
)
{
{
aChartLstnrCntnr
.
ChartDataChanged
(
);
lcl_SendChartEvent
(
*
this
,
m_ChartListeners
);
bFirstColumnAsLabel
=
bTmp
;
bFirstColumnAsLabel
=
bTmp
;
}
}
}
}
...
@@ -3599,10 +3618,13 @@ void SwXTextTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
...
@@ -3599,10 +3618,13 @@ void SwXTextTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
if
(
!
GetRegisteredIn
())
if
(
!
GetRegisteredIn
())
{
{
aLstnrCntnr
.
Disposing
();
aLstnrCntnr
.
Disposing
();
aChartLstnrCntnr
.
Disposing
();
lang
::
EventObject
const
ev
(
static_cast
<
::
cppu
::
OWeakObject
&>
(
*
this
));
m_ChartListeners
.
disposeAndClear
(
ev
);
}
}
else
else
aChartLstnrCntnr
.
ChartDataChanged
();
{
lcl_SendChartEvent
(
*
this
,
m_ChartListeners
);
}
}
}
OUString
SAL_CALL
SwXTextTable
::
getImplementationName
(
void
)
throw
(
uno
::
RuntimeException
)
OUString
SAL_CALL
SwXTextTable
::
getImplementationName
(
void
)
throw
(
uno
::
RuntimeException
)
...
@@ -3676,10 +3698,10 @@ uno::Sequence< OUString > SwXCellRange::getSupportedServiceNames(void) throw( un
...
@@ -3676,10 +3698,10 @@ uno::Sequence< OUString > SwXCellRange::getSupportedServiceNames(void) throw( un
SwXCellRange
::
SwXCellRange
(
SwUnoCrsr
*
pCrsr
,
SwFrmFmt
&
rFrmFmt
,
SwXCellRange
::
SwXCellRange
(
SwUnoCrsr
*
pCrsr
,
SwFrmFmt
&
rFrmFmt
,
SwRangeDescriptor
&
rDesc
)
SwRangeDescriptor
&
rDesc
)
:
:
SwClient
(
&
rFrmFmt
)
SwClient
(
&
rFrmFmt
),
,
aCursorDepend
(
this
,
pCrsr
)
aCursorDepend
(
this
,
pCrsr
),
,
m_ChartListeners
(
m_Mutex
)
aChartLstnrCntnr
((
cppu
::
OWeakObject
*
)
this
)
,
,
aRgDesc
(
rDesc
),
aRgDesc
(
rDesc
),
m_pPropSet
(
aSwMapProvider
.
GetPropertySet
(
PROPERTY_MAP_TABLE_RANGE
)),
m_pPropSet
(
aSwMapProvider
.
GetPropertySet
(
PROPERTY_MAP_TABLE_RANGE
)),
pTblCrsr
(
pCrsr
),
pTblCrsr
(
pCrsr
),
...
@@ -3880,7 +3902,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
...
@@ -3880,7 +3902,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
sal_Bool
bTmp
=
*
(
sal_Bool
*
)
aValue
.
getValue
();
sal_Bool
bTmp
=
*
(
sal_Bool
*
)
aValue
.
getValue
();
if
(
bFirstRowAsLabel
!=
bTmp
)
if
(
bFirstRowAsLabel
!=
bTmp
)
{
{
aChartLstnrCntnr
.
ChartDataChanged
(
);
lcl_SendChartEvent
(
*
this
,
m_ChartListeners
);
bFirstRowAsLabel
=
bTmp
;
bFirstRowAsLabel
=
bTmp
;
}
}
}
}
...
@@ -3890,7 +3912,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
...
@@ -3890,7 +3912,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
sal_Bool
bTmp
=
*
(
sal_Bool
*
)
aValue
.
getValue
();
sal_Bool
bTmp
=
*
(
sal_Bool
*
)
aValue
.
getValue
();
if
(
bFirstColumnAsLabel
!=
bTmp
)
if
(
bFirstColumnAsLabel
!=
bTmp
)
{
{
aChartLstnrCntnr
.
ChartDataChanged
(
);
lcl_SendChartEvent
(
*
this
,
m_ChartListeners
);
bFirstColumnAsLabel
=
bTmp
;
bFirstColumnAsLabel
=
bTmp
;
}
}
}
}
...
@@ -4517,17 +4539,20 @@ void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& Column
...
@@ -4517,17 +4539,20 @@ void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& Column
}
}
}
}
void
SwXCellRange
::
addChartDataChangeEventListener
(
const
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
&
aListener
)
throw
(
uno
::
RuntimeException
)
void
SAL_CALL
SwXCellRange
::
addChartDataChangeEventListener
(
const
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
&
xListener
)
throw
(
uno
::
RuntimeException
)
{
{
if
(
!
GetRegisteredIn
())
// no need to lock here as m_pImpl is const and container threadsafe
throw
uno
::
RuntimeException
();
m_ChartListeners
.
addInterface
(
xListener
);
aChartLstnrCntnr
.
AddListener
(
aListener
.
get
());
}
}
void
SwXCellRange
::
removeChartDataChangeEventListener
(
const
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
&
aListener
)
throw
(
uno
::
RuntimeException
)
void
SAL_CALL
SwXCellRange
::
removeChartDataChangeEventListener
(
const
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
&
xListener
)
throw
(
uno
::
RuntimeException
)
{
{
if
(
!
GetRegisteredIn
()
||
!
aChartLstnrCntnr
.
RemoveListener
(
aListener
.
get
()))
// no need to lock here as m_pImpl is const and container threadsafe
throw
uno
::
RuntimeException
(
);
m_ChartListeners
.
removeInterface
(
xListener
);
}
}
sal_Bool
SwXCellRange
::
isNotANumber
(
double
/*fNumber*/
)
throw
(
uno
::
RuntimeException
)
sal_Bool
SwXCellRange
::
isNotANumber
(
double
/*fNumber*/
)
throw
(
uno
::
RuntimeException
)
...
@@ -4597,10 +4622,13 @@ void SwXCellRange::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
...
@@ -4597,10 +4622,13 @@ void SwXCellRange::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
delete pTblCrsr;
delete pTblCrsr;
*/
*/
pTblCrsr
=
0
;
pTblCrsr
=
0
;
aChartLstnrCntnr
.
Disposing
();
lang
::
EventObject
const
ev
(
static_cast
<
::
cppu
::
OWeakObject
&>
(
*
this
));
m_ChartListeners
.
disposeAndClear
(
ev
);
}
}
else
else
aChartLstnrCntnr
.
ChartDataChanged
();
{
lcl_SendChartEvent
(
*
this
,
m_ChartListeners
);
}
}
}
/******************************************************************
/******************************************************************
...
@@ -5028,33 +5056,4 @@ void SwXTableColumns::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
...
@@ -5028,33 +5056,4 @@ void SwXTableColumns::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
ClientModify
(
this
,
pOld
,
pNew
);
ClientModify
(
this
,
pOld
,
pNew
);
}
}
void
SwChartEventListenerContainer
::
ChartDataChanged
()
{
if
(
pListenerArr
)
{
//TODO: find appropriate settings of the Event
lang
::
EventObject
aObj
(
pxParent
);
chart
::
ChartDataChangeEvent
aEvent
;
aEvent
.
Type
=
chart
::
ChartDataChangeType_ALL
;
aEvent
.
StartColumn
=
0
;
aEvent
.
EndColumn
=
1
;
aEvent
.
StartRow
=
0
;
aEvent
.
EndRow
=
1
;
for
(
sal_uInt16
i
=
0
;
i
<
pListenerArr
->
size
();
i
++
)
{
try
{
XEventListenerPtr
pElem
=
(
*
pListenerArr
)[
i
];
uno
::
Reference
<
lang
::
XEventListener
>
xEventListener
=
*
pElem
;
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
xChartEventListener
=
(
chart
::
XChartDataChangeEventListener
*
)(
*
pElem
).
get
();
xChartEventListener
->
chartDataChanged
(
aEvent
);
}
catch
(
uno
::
Exception
const
&
)
{
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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