summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-06-10 13:25:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-06-10 13:30:34 +0100
commitb523e20a8fb8c9c26e7ffdc1b3f5fd06c440985c (patch)
treefdbdea3f1b391690b59f9168eda90609efdcab31
parent895468d7388ee17ba33804f19bad52933312ae5d (diff)
If we set TextFitToSize we have to unset TextAutoGrow[Height|Width]
e.g. like ImpSetAttributesFitToSize and ImpSetAttributesFitToSizeVertical do otherwise you can right click on an outline->text change the value from its default of "fit to frame" to "fit to width" ok, then use rightclick->autofit to toggle "fit to frame" on and now revisit outline->text and all three are set and none can be toggled off Change-Id: I48e2f364679e055ac776f1e7c5a04efaa2b6d0d2 (cherry picked from commit 8f04f1a1093f0cab56b9cd3872f7667011f9fcf4)
-rw-r--r--sd/source/ui/view/drviews2.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index bbfe30b33207..6a88b01d88c3 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -219,6 +219,15 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
+ if (!bSet)
+ {
+ //If we are turning on AutoFit we have to turn these off if already on
+ if (static_cast<const SdrOnOffItem*>(pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_AUTOGROWHEIGHT))->GetValue())
+ pObj->SetMergedItem(makeSdrTextAutoGrowHeightItem(false));
+ if (static_cast<const SdrOnOffItem*>(pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_AUTOGROWWIDTH))->GetValue())
+ pObj->SetMergedItem(makeSdrTextAutoGrowWidthItem(false));
+ }
+
pObj->SetMergedItem(SdrTextFitToSizeTypeItem(bSet ? SDRTEXTFIT_NONE : SDRTEXTFIT_AUTOFIT));
mpDrawView->EndUndo();