summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authormatteocam <matteo.campanelli@gmail.com>2015-08-05 13:18:26 +0200
committermatteocam <matteo.campanelli@gmail.com>2015-08-05 13:18:26 +0200
commit0cd61255022e054c795baf364b1a0e0ceca9cc76 (patch)
tree74f37aa89b46adf47abb9fe9ded30ca54fcc69ca /svx/source
parent37ff6848c22ea01a621468808263dfdfaac69e17 (diff)
Handle Pending Overflow Check for domino chaining
Change-Id: I9053f858c97f68f99cea3705e08e374aedc53107
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/svdraw/svdotxed.cxx16
-rw-r--r--svx/source/svdraw/textchain.cxx65
-rw-r--r--svx/source/svdraw/textchaincursor.cxx7
3 files changed, 25 insertions, 63 deletions
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 72c6ca4ac87b..02c800fe1222 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -28,6 +28,7 @@
#include <svl/itemset.hxx>
#include <editeng/eeitem.hxx>
#include <svx/sdtfchim.hxx>
+#include <svx/textchain.hxx>
bool SdrTextObj::HasTextEdit() const
@@ -280,8 +281,23 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
SetOutlinerParaObject(pNewText);
}
+ /* Beginning Chaining-related code */
// we do not need the bookmark at the overflowing check anymore.
rOutl.ClearOverflowingParaNum();
+ // XXX: Experiment
+ /* Flush overflow for next textbox */
+ if (IsChainable() &&
+ GetNextLinkInChain() &&
+ GetTextChain()->GetPendingOverflowCheck(GetNextLinkInChain()) )
+ {
+ GetTextChain()->SetPendingOverflowCheck(GetNextLinkInChain(), false);
+ // NEXT: Prepare outliner for overflow
+ SdrOutliner rDrawOutl = GetNextLinkInChain()->ImpGetDrawOutliner();
+ rDrawOutl.SetUpdateMode(true);
+ // XXX: Change name of method above to impHandleChainingEventsNonEditMode
+ GetNextLinkInChain()->impHandleChainingEventsDuringDecomposition(rDrawOutl);
+ }
+ /* End Chaining-related code */
pEdtOutl = NULL;
rOutl.Clear();
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index c19b9241809e..911e0060ef24 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -30,6 +30,8 @@ IMPL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool)
IMPL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection)
IMPL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection)
IMPL_CHAIN_PROP_INTERFACE(IsPartOfLastParaInNextLink, bool)
+IMPL_CHAIN_PROP_INTERFACE(PendingOverflowCheck, bool)
+
/* End Definition of Properties Interface */
@@ -46,69 +48,6 @@ TextChain::~TextChain()
// XXX: Should free all LinkProperties
}
-/*
-bool TextChain::IsLinkInChain(SdrTextObj *) const
-{
- return true; // XXX: Should make an actual check
-}
-
-void TextChain::AppendLink(SdrTextObj *)
-{
- // XXX
-}
-
-SdrTextObj *TextChain::GetNextLink(const SdrTextObj *pTextObj) const
-{
- return impGetNextLink(pTextObj);
-}
-
-SdrTextObj *TextChain::GetPrevLink(const SdrTextObj *pTextObj) const
-{
- return impGetPrevLink(pTextObj);
-}
-
-SdrTextObj *TextChain::impGetNextLink(const SdrTextObj *pTextObj) const
-{
- // XXX: Temporary implementation based on index number
-
- 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(const SdrTextObj *pTextObj) const
-{
- SdrTextObj *pPrevTextObj = NULL;
- SdrPage *pPage = pTextObj->pPage;
-
- if ( pPage && pPage->GetObjCount() > 1) {
-
- sal_Int32 prevIndex = (pTextObj->GetOrdNum()-1);
-
- if (prevIndex >= 0)
- pPrevTextObj = dynamic_cast< SdrTextObj * >( pPage->GetObj( prevIndex ) );
-
- return pPrevTextObj;
- } else {
- fprintf(stderr, "Make New Object please\n");
- return NULL;
- }
-}
-*/
-
-
ImpChainLinkProperties *TextChain::GetLinkProperties(const SdrTextObj *pLink)
{
// if the guy does not already have properties in the map make them
diff --git a/svx/source/svdraw/textchaincursor.cxx b/svx/source/svdraw/textchaincursor.cxx
index 6daf59b78ac7..87c8f8663ad6 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -189,6 +189,13 @@ void TextChainCursorManager::impChangeEditingTextObj(SdrTextObj *pTargetTextObj,
{
assert(pTargetTextObj);
+ // To ensure that we check for overflow in the next box // This is handled in SdrTextObj::EndTextEdit
+ SdrTextObj *pNextLink = mpTextObj->GetNextLinkInChain();
+ TextChain *pTextChain = mpTextObj->GetTextChain();
+ // If we are moving forward
+ if (pNextLink && pTargetTextObj == pNextLink)
+ pTextChain->SetPendingOverflowCheck(pNextLink, true);
+
mpEditView->SdrEndTextEdit();
mpEditView->SdrBeginTextEdit(pTargetTextObj);
// OutlinerView has changed, so we update the pointer