[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - 3 commits - svx/source
matteocam
matteo.campanelli at gmail.com
Tue Aug 18 05:27:01 PDT 2015
svx/source/svdraw/textchainflow.cxx | 42 +++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 12 deletions(-)
New commits:
commit b876fcab266ab63105e29f2b526f6df5ef654944
Author: matteocam <matteo.campanelli at gmail.com>
Date: Tue Aug 18 14:25:55 2015 +0200
Set UpdateMode=True before transfering text in OF/UF
Change-Id: Id01abf614bd4c842d86aa644b947f6295d6d7d6d
diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx
index 82bb4cd..06275e15 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -156,6 +156,12 @@ bool TextChainFlow::IsUnderflow() const
// XXX:Would it be possible to unify undeflow and its possibly following overrflow?
void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
{
+ bool bOldUpdateMode = pOutl->GetUpdateMode();
+
+ // We need this since it's required by WriteRTF
+ pOutl->SetUpdateMode(true);
+
+
//GetTextChain()->SetNilChainingEvent(mpTargetLink, true);
// making whole text
OutlinerParaObject *pNewText = impGetMergedUnderflowParaObject(pOutl);
@@ -173,6 +179,9 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
pOutl->SetMaxAutoPaperSize(aOldSize);
pOutl->SetText(*pNewText);
+ // Reset update mode
+ pOutl->SetUpdateMode(bOldUpdateMode);
+
//GetTextChain()->SetNilChainingEvent(mpTargetLink, false);
// Check for new overflow
@@ -181,6 +190,11 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
void TextChainFlow::ExecuteOverflow(SdrOutliner *pNonOverflOutl, SdrOutliner *pOverflOutl)
{
+ bool bOldUpdateMode = pNonOverflOutl->GetUpdateMode();
+
+ // We need this since it's required by WriteRTF
+ pNonOverflOutl->SetUpdateMode(true);
+
//GetTextChain()->SetNilChainingEvent(mpTargetLink, true);
// Leave only non overflowing text
impLeaveOnlyNonOverflowingText(pNonOverflOutl);
@@ -191,6 +205,9 @@ void TextChainFlow::ExecuteOverflow(SdrOutliner *pNonOverflOutl, SdrOutliner *pO
impMoveChainedTextToNextLink(pOverflOutl);
}
+ // Reset update mode
+ pNonOverflOutl->SetUpdateMode(bOldUpdateMode);
+
//GetTextChain()->SetNilChainingEvent(mpTargetLink, false);
}
commit 3476f9dc1ceab8dedb08888f93ee9d5cf87f2f30
Author: matteocam <matteo.campanelli at gmail.com>
Date: Tue Aug 18 14:20:33 2015 +0200
Set UpdateMode=True even with editing outl
Change-Id: I18773c8ff7447741e87d25b849b6f6b2770531dc
diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx
index d74e441..82bb4cd 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -71,12 +71,12 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p
{
bool bOldUpdateMode = pFlowOutl->GetUpdateMode();
- // XXX: This could be reorganized moving most of this stuff inside EditingTextChainFlow (we need update=true anyway for TextChainFlow though)
+ // We need this since it's required to check overflow
+ pFlowOutl->SetUpdateMode(true);
+
+ // XXX: This could be reorganized moving most of this stuff inside EditingTextChainFlow
if (pParamOutl != NULL)
{
- // We need this since it's required to check overflow
- pFlowOutl->SetUpdateMode(true);
-
// XXX: does this work if you do it before setting the text? Seems so.
impSetFlowOutlinerParams(pFlowOutl, pParamOutl);
}
@@ -87,10 +87,9 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p
bOverflow = bIsPageOverflow && mpNextLink;
bUnderflow = !bIsPageOverflow && mpNextLink && mpNextLink->HasText();
- if (pParamOutl != NULL)
- {
- pFlowOutl->SetUpdateMode(bOldUpdateMode);
- }
+ // Reset update mode
+ pFlowOutl->SetUpdateMode(bOldUpdateMode);
+
// Get old state on whether to merge para-s or not
// NOTE: We handle UF/OF using the _old_ state. The new one is simply saved
commit 4ad93ff450e53263a32dff01239aacd876e81e28
Author: matteocam <matteo.campanelli at gmail.com>
Date: Tue Aug 18 14:18:59 2015 +0200
Minor changes
Change-Id: Ife0861db9249dab3102399365ca965ca53b34e42
diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx
index 94fac05..d74e441 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -244,10 +244,12 @@ SdrTextObj *TextChainFlow::GetNextLink() const
return mpNextLink;
}
-OutlinerParaObject *TextChainFlow::impGetOverflowingParaObject(SdrOutliner *pOutliner)
-{
- return mpOverflChText->CreateOverflowingParaObject(pOutliner,
- mpNextLink->GetOutlinerParaObject());
+OutlinerParaObject *TextChainFlow::impGetOverflowingParaObject(SdrOutliner *)
+{ // XXX: Should never be called (to be deleted)
+ assert(0);
+ return NULL;
+ //return mpOverflChText->CreateOverflowingParaObject(pOutliner,
+// mpNextLink->GetOutlinerParaObject());
}
OutlinerParaObject *TextChainFlow::impGetMergedUnderflowParaObject(SdrOutliner *pOutliner)
More information about the Libreoffice-commits
mailing list