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
1fb1016e
Kaydet (Commit)
1fb1016e
authored
Mar 14, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Pipe legacy Modify calls through SwClientModify
Change-Id: Ic55abdee0486021d8361271fabec9fcaa06c3502
üst
ea7f16bf
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
15 deletions
+38
-15
calbck.hxx
sw/inc/calbck.hxx
+30
-12
ddetbl.cxx
sw/source/core/fields/ddetbl.cxx
+2
-1
atrfrm.cxx
sw/source/core/layout/atrfrm.cxx
+2
-1
sectfrm.cxx
sw/source/core/layout/sectfrm.cxx
+1
-0
atrfld.cxx
sw/source/core/txtnode/atrfld.cxx
+2
-1
ndtxt.cxx
sw/source/core/txtnode/ndtxt.cxx
+1
-0
No files found.
sw/inc/calbck.hxx
Dosyayı görüntüle @
1fb1016e
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include <ring.hxx>
#include <ring.hxx>
#include <hintids.hxx>
#include <hintids.hxx>
#include <hints.hxx>
#include <hints.hxx>
#include <typeinfo>
class
SwModify
;
class
SwModify
;
...
@@ -65,6 +66,12 @@ class SwClient;
...
@@ -65,6 +66,12 @@ class SwClient;
class
SwClientIter
;
class
SwClientIter
;
namespace
sw
namespace
sw
{
{
struct
LegacyModifyHint
SAL_FINAL
:
SfxHint
{
LegacyModifyHint
(
const
SfxPoolItem
*
pOld
,
const
SfxPoolItem
*
pNew
)
:
m_pOld
(
pOld
),
m_pNew
(
pNew
)
{};
const
SfxPoolItem
*
m_pOld
;
const
SfxPoolItem
*
m_pNew
;
};
/// refactoring out the some of the more sane SwClient functionality
/// refactoring out the some of the more sane SwClient functionality
class
SW_DLLPUBLIC
WriterListener
:
::
boost
::
noncopyable
class
SW_DLLPUBLIC
WriterListener
:
::
boost
::
noncopyable
{
{
...
@@ -79,11 +86,7 @@ namespace sw
...
@@ -79,11 +86,7 @@ namespace sw
:
m_pLeft
(
nullptr
),
m_pRight
(
nullptr
)
:
m_pLeft
(
nullptr
),
m_pRight
(
nullptr
)
{}
{}
virtual
~
WriterListener
()
{};
virtual
~
WriterListener
()
{};
// callbacks received from SwModify (friend class - so these methods can be private)
virtual
void
SwClientNotify
(
const
SwModify
&
,
const
SfxHint
&
rHint
)
=
0
;
// should be called only from SwModify the client is registered in
// mba: IMHO these methods should be pure virtual
virtual
void
Modify
(
const
SfxPoolItem
*
,
const
SfxPoolItem
*
)
{};
virtual
void
SwClientNotify
(
const
SwModify
&
,
const
SfxHint
&
)
{};
public
:
public
:
bool
IsLast
()
const
{
return
!
m_pLeft
&&
!
m_pRight
;
}
bool
IsLast
()
const
{
return
!
m_pLeft
&&
!
m_pRight
;
}
};
};
...
@@ -108,8 +111,20 @@ public:
...
@@ -108,8 +111,20 @@ public:
SwClient
()
:
pRegisteredIn
(
nullptr
)
{}
SwClient
()
:
pRegisteredIn
(
nullptr
)
{}
virtual
~
SwClient
()
SAL_OVERRIDE
;
virtual
~
SwClient
()
SAL_OVERRIDE
;
// callbacks received from SwModify (friend class - so these methods can be private)
// should be called only from SwModify the client is registered in
// mba: IMHO this method should be pure virtual
// DO NOT USE IN NEW CODE! use SwClientNotify instead.
virtual
void
Modify
(
const
SfxPoolItem
*
pOldValue
,
const
SfxPoolItem
*
pNewValue
)
SAL_OVERRIDE
virtual
void
Modify
(
const
SfxPoolItem
*
pOldValue
,
const
SfxPoolItem
*
pNewValue
)
SAL_OVERRIDE
{
CheckRegistration
(
pOldValue
,
pNewValue
);
}
{
CheckRegistration
(
pOldValue
,
pNewValue
);
}
// when overriding this, you MUST call SwClient::SwClientModify() in the override!
virtual
void
SwClientNotify
(
const
SwModify
&
,
const
SfxHint
&
rHint
)
{
// assuming the compiler to realize that a dynamic_cast to a final class is just a pointer compare ...
auto
pLegacyHint
(
dynamic_cast
<
const
sw
::
LegacyModifyHint
*>
(
&
rHint
));
if
(
pLegacyHint
)
Modify
(
pLegacyHint
->
m_pOld
,
pLegacyHint
->
m_pNew
);
};
// in case an SwModify object is destroyed that itself is registered in another SwModify,
// in case an SwModify object is destroyed that itself is registered in another SwModify,
// its SwClient objects can decide to get registered to the latter instead by calling this method
// its SwClient objects can decide to get registered to the latter instead by calling this method
...
@@ -144,6 +159,7 @@ class SW_DLLPUBLIC SwModify: public SwClient
...
@@ -144,6 +159,7 @@ class SW_DLLPUBLIC SwModify: public SwClient
bool
bInSwFntCache
:
1
;
bool
bInSwFntCache
:
1
;
// mba: IMHO this method should be pure virtual
// mba: IMHO this method should be pure virtual
// DO NOT USE IN NEW CODE! use CallSwClientNotify instead.
virtual
void
Modify
(
const
SfxPoolItem
*
pOld
,
const
SfxPoolItem
*
pNew
)
SAL_OVERRIDE
virtual
void
Modify
(
const
SfxPoolItem
*
pOld
,
const
SfxPoolItem
*
pNew
)
SAL_OVERRIDE
{
NotifyClients
(
pOld
,
pNew
);
};
{
NotifyClients
(
pOld
,
pNew
);
};
...
@@ -151,23 +167,25 @@ public:
...
@@ -151,23 +167,25 @@ public:
SwModify
()
SwModify
()
:
SwClient
(
nullptr
),
pRoot
(
nullptr
),
bModifyLocked
(
false
),
bLockClientList
(
false
),
bInDocDTOR
(
false
),
bInCache
(
false
),
bInSwFntCache
(
false
)
:
SwClient
(
nullptr
),
pRoot
(
nullptr
),
bModifyLocked
(
false
),
bLockClientList
(
false
),
bInDocDTOR
(
false
),
bInCache
(
false
),
bInSwFntCache
(
false
)
{}
{}
explicit
SwModify
(
SwModify
*
pToRegisterIn
)
:
SwClient
(
pToRegisterIn
),
pRoot
(
nullptr
),
bModifyLocked
(
false
),
bLockClientList
(
false
),
bInDocDTOR
(
false
),
bInCache
(
false
),
bInSwFntCache
(
false
)
{}
// broadcasting: send notifications to all clients
// broadcasting: send notifications to all clients
// DO NOT USE IN NEW CODE! use CallSwClientNotify instead.
void
NotifyClients
(
const
SfxPoolItem
*
pOldValue
,
const
SfxPoolItem
*
pNewValue
);
void
NotifyClients
(
const
SfxPoolItem
*
pOldValue
,
const
SfxPoolItem
*
pNewValue
);
// DO NOT USE IN NEW CODE! use CallSwClientNotify instead.
void
ModifyBroadcast
(
const
SfxPoolItem
*
pOldValue
,
const
SfxPoolItem
*
pNewValue
)
{
CallSwClientNotify
(
sw
::
LegacyModifyHint
{
pOldValue
,
pNewValue
}
);
};
// the same, but without setting bModifyLocked or checking for any of the flags
// the same, but without setting bModifyLocked or checking for any of the flags
// mba: it would be interesting to know why this is necessary
// mba: it would be interesting to know why this is necessary
// also allows to limit callback to certain type (HACK)
// also allows to limit callback to certain type (HACK)
inline
void
ModifyBroadcast
(
const
SfxPoolItem
*
pOldValue
,
const
SfxPoolItem
*
pNewValue
,
TypeId
nType
=
TYPE
(
SwClient
)
);
// DO NOT USE IN NEW CODE! use CallSwClientNotify instead.
inline
void
ModifyBroadcast
(
const
SfxPoolItem
*
pOldValue
,
const
SfxPoolItem
*
pNewValue
,
TypeId
nType
);
// a more universal broadcasting mechanism
// a more universal broadcasting mechanism
inline
void
CallSwClientNotify
(
const
SfxHint
&
rHint
)
const
;
inline
void
CallSwClientNotify
(
const
SfxHint
&
rHint
)
const
;
// single argument ctors shall be explicit.
explicit
SwModify
(
SwModify
*
pToRegisterIn
)
:
SwClient
(
pToRegisterIn
),
pRoot
(
nullptr
),
bModifyLocked
(
false
),
bLockClientList
(
false
),
bInDocDTOR
(
false
),
bInCache
(
false
),
bInSwFntCache
(
false
)
{}
virtual
~
SwModify
();
virtual
~
SwModify
();
void
Add
(
SwClient
*
pDepend
);
void
Add
(
SwClient
*
pDepend
);
...
...
sw/source/core/fields/ddetbl.cxx
Dosyayı görüntüle @
1fb1016e
...
@@ -86,8 +86,9 @@ void SwDDETable::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
...
@@ -86,8 +86,9 @@ void SwDDETable::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
SwTable
::
Modify
(
pOld
,
pNew
);
SwTable
::
Modify
(
pOld
,
pNew
);
}
}
void
SwDDETable
::
SwClientNotify
(
const
SwModify
&
,
const
SfxHint
&
rHint
)
void
SwDDETable
::
SwClientNotify
(
const
SwModify
&
rModify
,
const
SfxHint
&
rHint
)
{
{
SwClient
::
SwClientNotify
(
rModify
,
rHint
);
const
SwFieldHint
*
pHint
=
dynamic_cast
<
const
SwFieldHint
*>
(
&
rHint
);
const
SwFieldHint
*
pHint
=
dynamic_cast
<
const
SwFieldHint
*>
(
&
rHint
);
if
(
pHint
)
if
(
pHint
)
// replace DDETable by real table
// replace DDETable by real table
...
...
sw/source/core/layout/atrfrm.cxx
Dosyayı görüntüle @
1fb1016e
...
@@ -628,8 +628,9 @@ SfxPoolItem* SwFmtPageDesc::Clone( SfxItemPool* ) const
...
@@ -628,8 +628,9 @@ SfxPoolItem* SwFmtPageDesc::Clone( SfxItemPool* ) const
return
new
SwFmtPageDesc
(
*
this
);
return
new
SwFmtPageDesc
(
*
this
);
}
}
void
SwFmtPageDesc
::
SwClientNotify
(
const
SwModify
&
,
const
SfxHint
&
rHint
)
void
SwFmtPageDesc
::
SwClientNotify
(
const
SwModify
&
rModify
,
const
SfxHint
&
rHint
)
{
{
SwClient
::
SwClientNotify
(
rModify
,
rHint
);
const
SwPageDescHint
*
pHint
=
dynamic_cast
<
const
SwPageDescHint
*>
(
&
rHint
);
const
SwPageDescHint
*
pHint
=
dynamic_cast
<
const
SwPageDescHint
*>
(
&
rHint
);
if
(
pHint
)
if
(
pHint
)
{
{
...
...
sw/source/core/layout/sectfrm.cxx
Dosyayı görüntüle @
1fb1016e
...
@@ -2283,6 +2283,7 @@ void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
...
@@ -2283,6 +2283,7 @@ void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
void
SwSectionFrm
::
SwClientNotify
(
const
SwModify
&
rMod
,
const
SfxHint
&
rHint
)
void
SwSectionFrm
::
SwClientNotify
(
const
SwModify
&
rMod
,
const
SfxHint
&
rHint
)
{
{
SwClient
::
SwClientNotify
(
rMod
,
rHint
);
// #i117863#
// #i117863#
const
SwSectionFrmMoveAndDeleteHint
*
pHint
=
const
SwSectionFrmMoveAndDeleteHint
*
pHint
=
dynamic_cast
<
const
SwSectionFrmMoveAndDeleteHint
*>
(
&
rHint
);
dynamic_cast
<
const
SwSectionFrmMoveAndDeleteHint
*>
(
&
rHint
);
...
...
sw/source/core/txtnode/atrfld.cxx
Dosyayı görüntüle @
1fb1016e
...
@@ -204,8 +204,9 @@ void SwFmtFld::InvalidateField()
...
@@ -204,8 +204,9 @@ void SwFmtFld::InvalidateField()
NotifyClients
(
&
item
,
&
item
);
NotifyClients
(
&
item
,
&
item
);
}
}
void
SwFmtFld
::
SwClientNotify
(
const
SwModify
&
,
const
SfxHint
&
rHint
)
void
SwFmtFld
::
SwClientNotify
(
const
SwModify
&
rModify
,
const
SfxHint
&
rHint
)
{
{
SwClient
::
SwClientNotify
(
rModify
,
rHint
);
if
(
!
mpTxtFld
)
if
(
!
mpTxtFld
)
return
;
return
;
...
...
sw/source/core/txtnode/ndtxt.cxx
Dosyayı görüntüle @
1fb1016e
...
@@ -5069,6 +5069,7 @@ bool SwTxtNode::IsInContent() const
...
@@ -5069,6 +5069,7 @@ bool SwTxtNode::IsInContent() const
void
SwTxtNode
::
SwClientNotify
(
const
SwModify
&
rModify
,
const
SfxHint
&
rHint
)
void
SwTxtNode
::
SwClientNotify
(
const
SwModify
&
rModify
,
const
SfxHint
&
rHint
)
{
{
SwClient
::
SwClientNotify
(
rModify
,
rHint
);
const
SwAttrHint
*
pHint
=
dynamic_cast
<
const
SwAttrHint
*>
(
&
rHint
);
const
SwAttrHint
*
pHint
=
dynamic_cast
<
const
SwAttrHint
*>
(
&
rHint
);
if
(
pHint
&&
pHint
->
GetId
()
==
RES_CONDTXTFMTCOLL
&&
&
rModify
==
GetRegisteredIn
()
)
if
(
pHint
&&
pHint
->
GetId
()
==
RES_CONDTXTFMTCOLL
&&
&
rModify
==
GetRegisteredIn
()
)
ChkCondColl
();
ChkCondColl
();
...
...
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