summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatteocam <matteo.campanelli@gmail.com>2015-08-20 18:01:20 +0200
committermatteocam <matteo.campanelli@gmail.com>2015-08-20 18:01:20 +0200
commitb35661fab277d98e9b45df6626e947c1edd597dd (patch)
tree2fe9a4330d8dfe0527a4af87e92175b13d32b6c7
parent0dccde9fc86aa74061d39e72c5139477d560c0a3 (diff)
Set UpdateMode to true only if necessary
Change-Id: If4c0517328271ce2b1c7e184981de6c2b7c14560
-rw-r--r--svx/source/svdraw/textchainflow.cxx25
1 files changed, 5 insertions, 20 deletions
diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx
index 9739eee37fd2..cad0b3c84d2f 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();
- // 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);
}
@@ -105,7 +105,8 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p
NULL;
// Reset update mode // Reset it here because we use WriteRTF (needing updatemode = true) in the two constructors above
- pFlowOutl->SetUpdateMode(bOldUpdateMode);
+ if (!bOldUpdateMode) // Reset only if the old value was false
+ pFlowOutl->SetUpdateMode(bOldUpdateMode);
// NOTE: Must be called after mp*ChText abd b*flow have been set but before mbOFisUFinduced is reset
impUpdateCursorInfo();
@@ -155,11 +156,6 @@ 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
@@ -180,9 +176,6 @@ 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
@@ -191,11 +184,6 @@ 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);
@@ -206,9 +194,6 @@ void TextChainFlow::ExecuteOverflow(SdrOutliner *pNonOverflOutl, SdrOutliner *pO
impMoveChainedTextToNextLink(pOverflOutl);
}
- // Reset update mode
- pNonOverflOutl->SetUpdateMode(bOldUpdateMode);
-
//GetTextChain()->SetNilChainingEvent(mpTargetLink, false);
}