[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
matteocam
matteo.campanelli at gmail.com
Thu Jul 9 11:57:19 PDT 2015
editeng/source/outliner/overflowingtxt.cxx | 22 +++++++++++++++++++++-
include/editeng/overflowingtxt.hxx | 12 ++++++++----
2 files changed, 29 insertions(+), 5 deletions(-)
New commits:
commit 6c36f1508baf0089f260e4ad7ddff57532bb125f
Author: matteocam <matteo.campanelli at gmail.com>
Date: Thu Jul 9 14:52:01 2015 -0400
Clone EditTextObjects before using them for *OverflowingText
Change-Id: I0624b90967d5599534b3b159cb3e0838778ec3d9
diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx
index 868daa6..339a335 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -25,6 +25,9 @@
#include <editeng/outlobj.hxx>
#include <editeng/editobj.hxx>
+
+// Helper function for *OverflowingText classes
+
ESelection getLastPositionSel(const EditTextObject *pTObj)
{
sal_Int32 nLastPara = pTObj->GetParagraphCount()-1;
@@ -37,8 +40,12 @@ ESelection getLastPositionSel(const EditTextObject *pTObj)
return aEndPos;
}
-OverflowingText::OverflowingText(EditTextObject *pTObj) : mpContentTextObj(pTObj)
+// class OverflowingText
+
+OverflowingText::OverflowingText(EditTextObject *pTObj)
+ : mpContentTextObj(pTObj->Clone())
{
+ // XXX: may have to delete pTObj
}
ESelection OverflowingText::GetInsertionPointSel() const
@@ -46,6 +53,15 @@ ESelection OverflowingText::GetInsertionPointSel() const
return getLastPositionSel(mpContentTextObj);
}
+// class NonOverflowingText
+
+NonOverflowingText::NonOverflowingText(const EditTextObject *pTObj)
+ : mpContentTextObj(pTObj->Clone())
+{
+ // XXX: may have to delete pTObj
+}
+
+
OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const
{
OutlinerParaObject *pPObj = new OutlinerParaObject(*mpContentTextObj);
@@ -87,6 +103,8 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou
return pPObj;
}
+// class OFlowChainedText
+
OFlowChainedText::OFlowChainedText(Outliner *pOutl)
{
mpOverflowingTxt = pOutl->GetOverflowingText();
@@ -120,6 +138,8 @@ OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *p
return mpNonOverflowingTxt->ToParaObject(pOutliner);
}
+// classes UFlowChainedText
+
UFlowChainedText::UFlowChainedText(Outliner *pOutl)
{
mpUnderflowPObj = pOutl->CreateParaObject();
diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx
index 4e97fcc..72d2355 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -31,6 +31,11 @@ class OutlinerParaObject;
class EditTextObject;
class Outliner;
+/*
+ * The classes OverflowingText and NonOverflowingText handle the
+ * actual preparation of the OutlinerParaObjects to be used in destination
+ * and source box respectively.
+*/
class OverflowingText
{
@@ -58,9 +63,7 @@ public:
private:
// Constructor
- NonOverflowingText(const EditTextObject *pTObj)
- : mpContentTextObj(pTObj)
- { }
+ NonOverflowingText(const EditTextObject *pTObj);
friend class Outliner;
const EditTextObject *mpContentTextObj;
@@ -69,7 +72,8 @@ private:
/*
* classes OFlowChainedText and UFlowChainedText:
- * contain and handle the state of a broken up text _after_ a flow event.
+ * contain and handle the state of a broken up text _after_ a flow event
+ * (respectively after Overflow and Underflow).
*
*/
More information about the Libreoffice-commits
mailing list