include/svx/svdmodel.hxx | 5 +++++ include/svx/svdotext.hxx | 1 + include/svx/textchain.hxx | 3 +++ svx/source/svdraw/svdmodel.cxx | 14 ++++++++++++++ svx/source/svdraw/svdotext.cxx | 8 ++++++++ svx/source/svdraw/textchain.cxx | 5 +++++ 6 files changed, 36 insertions(+)
New commits: commit dde308668425a5849d49e3ac5040e2157141cc6c Author: matteocam <matteo.campane...@gmail.com> Date: Tue Jun 16 12:35:28 2015 -0400 Changed SdrModel and SdrTextObj to use TextChain Change-Id: I3e2e4cbe861f48366e3ab0abbe83c97e0aafe69b diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index bdc992d..c7f7233 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -75,6 +75,8 @@ class SotStorage; class SdrOutlinerCache; class SdrUndoFactory; class ImageMap; +class TextChain; + namespace comphelper { class IEmbeddedHelper; @@ -211,6 +213,8 @@ protected: sal_uInt16 nDefaultTabulator; sal_uInt32 nMaxUndoCount; + TextChain* pTextChain; + // sdr::Comment interface @@ -328,6 +332,7 @@ public: SdrOutliner& GetDrawOutliner(const SdrTextObj* pObj=NULL) const; SdrOutliner& GetChainingOutliner(const SdrTextObj* pObj=NULL) const; + TextChain *GetTextChain() const; SdrOutliner& GetHitTestOutliner() const { return *pHitTestOutliner; } const SdrTextObj* GetFormattingTextObj() const; diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 83b488e..bbc9207 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -361,6 +361,7 @@ public: bool IsChainable() const { return GetNextLinkInChain() != NULL; } void SetPreventChainable(); bool GetPreventChainable() const; + TextChain *GetTextChain() const; SdrObjKind GetTextKind() const { return eTextKind; } diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx index e094334..42dc999 100644 --- a/include/svx/textchain.hxx +++ b/include/svx/textchain.hxx @@ -29,6 +29,9 @@ class TextChain { void AppendLink(SdrTextObj *); SdrTextObj *GetNextLink(SdrTextObj *); + // return whether a paragraph is split between the two links in the argument + bool GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj *pNextLink); + }; #endif // INCLUDED_SVX_TEXTCHAIN_HXX diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index ce0ff7a..19652f4 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -54,6 +54,7 @@ #include <svx/svdpool.hxx> #include <svx/svdobj.hxx> #include <svx/svdotext.hxx> +#include <svx/textchain.hxx> #include <svx/svdetc.hxx> #include <svx/svdoutl.hxx> #include <svx/svdoole2.hxx> @@ -212,9 +213,17 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe pHitTestOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this ); ImpSetOutlinerDefaults(pHitTestOutliner, true); + // FIXME(matteocam) + /* Start Text Chaining related code */ + + // Initialize Chaining Outliner pChainingOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this ); ImpSetOutlinerDefaults(pChainingOutliner, true); + // Make a TextChain + pTextChain = new TextChain; + + /* End Text Chaining related code */ ImpCreateTables(); } @@ -1977,6 +1986,11 @@ void SdrModel::PageListChanged() { } +TextChain *SdrModel::GetTextChain() const +{ + return pTextChain; +} + const SdrPage* SdrModel::GetMasterPage(sal_uInt16 nPgNum) const { DBG_ASSERT(nPgNum < maMaPag.size(), "SdrModel::GetMasterPage: Access out of range (!)"); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 03b8388..cc17892 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1543,6 +1543,14 @@ void SdrTextObj::SetToBeChained(bool bToBeChained) mbToBeChained = bToBeChained; } +TextChain *SdrTextObj::GetTextChain() const +{ + if (!IsChainable()) + return NULL; + + return pModel->GetTextChain(); +} + void SdrTextObj::SetVerticalWriting(bool bVertical) { OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject(); diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx index 194d4d4..17595c9 100644 --- a/svx/source/svdraw/textchain.cxx +++ b/svx/source/svdraw/textchain.cxx @@ -32,3 +32,8 @@ SdrTextObj *TextChain::GetNextLink(SdrTextObj *) { return NULL; // XXX } + +bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj *pNextLink) +{ + +} _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits