[Libreoffice-commits] core.git: sd/source

Caolán McNamara caolanm at redhat.com
Fri Jun 10 12:30:26 UTC 2016


 sd/source/ui/view/drviews2.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 8f04f1a1093f0cab56b9cd3872f7667011f9fcf4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 10 13:25:43 2016 +0100

    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

diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index b78b8ce..36f954d 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();


More information about the Libreoffice-commits mailing list