summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authormatteocam <matteo.campanelli@gmail.com>2015-07-23 19:26:03 +0200
committermatteocam <matteo.campanelli@gmail.com>2015-07-31 12:16:10 +0200
commitce634e086b061ea8bc980da8e0f6deaee72bcd4c (patch)
tree159a89011fac0408dccdab3618bfb7c12881ff86 /svx
parent653598a235df9ee005364a332edcb5827761321d (diff)
Move implementation of next link in TextChain
Change-Id: If511e1d64af34d85470f1de5c43cbfb72651179e
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdotext.cxx18
-rw-r--r--svx/source/svdraw/textchain.cxx26
2 files changed, 23 insertions, 21 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index f315d01415cc..35b481beafd9 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2082,22 +2082,10 @@ void SdrTextObj::SetObjectItemNoBroadcast(const SfxPoolItem& rItem)
SdrTextObj* SdrTextObj::GetNextLinkInChain() const
{
- /* FIXME(matteocam) return mpNextInChain; */
- SdrTextObj *pNextTextObj = NULL;
-
- if ( pPage && pPage->GetObjCount() > 1) {
-
- sal_uInt32 nextIndex = (GetOrdNum()+1);
-
- if (nextIndex < pPage->GetObjCount())
- pNextTextObj = dynamic_cast< SdrTextObj * >( pPage->GetObj( nextIndex ) );
-
- return pNextTextObj;
- } else {
- fprintf(stderr, "Make New Object please\n");
- return NULL;
- }
+ if (GetTextChain())
+ return GetTextChain()->GetNextLink(this);
+ return NULL;
}
SdrTextObj* SdrTextObj::GetPrevLinkInChain() const
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index 787b298569cd..31ea1fda52f8 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -19,6 +19,7 @@
#include <svx/textchain.hxx>
#include <svx/svdotext.hxx>
+#include <svx/svdpage.hxx>
/*
* Definition of Properties Interface
@@ -55,23 +56,36 @@ void TextChain::AppendLink(SdrTextObj *)
// XXX
}
-SdrTextObj *TextChain::GetNextLink(SdrTextObj *pTextObj) const
+SdrTextObj *TextChain::GetNextLink(const SdrTextObj *pTextObj) const
{
return impGetNextLink(pTextObj);
}
-SdrTextObj *TextChain::GetPrevLink(SdrTextObj *pTextObj) const
+SdrTextObj *TextChain::GetPrevLink(const SdrTextObj *pTextObj) const
{
return impGetPrevLink(pTextObj);
}
-SdrTextObj *TextChain::impGetNextLink(SdrTextObj *pTextObj) const
+SdrTextObj *TextChain::impGetNextLink(const SdrTextObj *pTextObj) const
{
- // XXX: To be implemented
- return NULL;
+ SdrTextObj *pNextTextObj = NULL;
+ SdrPage *pPage = pTextObj->pPage;
+
+ if ( pPage && pPage->GetObjCount() > 1) {
+
+ sal_uInt32 nextIndex = (pTextObj->GetOrdNum()+1);
+
+ if (nextIndex < pPage->GetObjCount())
+ pNextTextObj = dynamic_cast< SdrTextObj * >( pPage->GetObj( nextIndex ) );
+
+ return pNextTextObj;
+ } else {
+ fprintf(stderr, "Make New Object please\n");
+ return NULL;
+ }
}
-SdrTextObj *TextChain::impGetPrevLink(SdrTextObj *pTextObj) const
+SdrTextObj *TextChain::impGetPrevLink(const SdrTextObj *pTextObj) const
{
// XXX: To be implemented
return NULL;