include/svx/svdotext.hxx       |    1 +
 svx/source/svdraw/svdotext.cxx |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 0a465a127873c94e16a7b98f3a834e8fd66b3232
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Jun 8 20:14:37 2015 -0400

    Defined IsChainable for SdrTextObj.
    
    Change-Id: I3b7437590473e7f0464dfe89e0e43b2d453ed667

diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 7583736..964ee43 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -354,6 +354,7 @@ public:
     // Chaining
     bool IsToBeChained() const;
     SdrTextObj *GetNextLinkInChain() const;
+    bool IsChainable() const { return GetNextLinkInChain() != NULL; }
 
     SdrObjKind GetTextKind() const { return eTextKind; }
 
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 519c5f8..ec10858 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2041,7 +2041,12 @@ SdrTextObj* SdrTextObj::GetNextLinkInChain() const
     SdrTextObj *pNextTextObj = NULL;
 
     if ( pPage && pPage->GetObjCount() > 1) {
-        int nextIndex = (GetOrdNum()+1) % pPage->GetObjCount();
+        int nextIndex = (GetOrdNum()+1);
+        // FIXME
+        if (nextIndex >= 3 || nextIndex >= pPage->GetObjCount()) {
+            fprintf(stderr, "Object not chainable\n");
+            return NULL;
+        }
         pNextTextObj =  dynamic_cast< SdrTextObj * >( pPage->GetObj( nextIndex 
) );
 
         return pNextTextObj;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to