summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-06-09 13:03:57 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-06-13 11:28:19 +0100
commit8d51397bfd98615e74e116582a50e29846ecb76e (patch)
tree3f9654a0ee5f51ae85efeec013eaa2ff5ced1061 /sd
parenta924d8f4c031504592a53e69c7c79c1359daa88a (diff)
Related: tdf#93135 adjust the ui to reflect the text fit options entanglement
We have two major groups of text fitting options in draw/impress ones that apply only to custom shapes * Word wrap text in shape * Resize shape to fit text those that apply to other elements, e.g. text boxes, legacy rectangles and lines * Fit width to text * Fit height to text * Fit to frame * Adjust to contour Of the second group, only "fit to frame" is always available. Text boxes have "Fit width to text" and "Fit height to text", while stuff like legacy rectangles and lines etc have "Adjust to contour" instead. A fun issue is that (currently anyway) the bit for "resize shape to fit text" in custom shapes and the bit for "fit height to text" in text boxes is the same bit, SDRATTR_TEXT_AUTOGROWHEIGHT. So before this change in all circumstances the same collection of checkboxes for all settings was visible. With context used to enable or disable which ones could be set according to the type of shape it was. Simultaneously there is logic to enable/disable checkboxes depending on if other checkboxes that control contradictionary options were checked/unchecked. e.g. "Fit to frame" disabled if "fit height to text" is enabled. So its not apparently why some can be enabled and some disabled by clicking about the place in the shared collection. In this commit we split the sizing options into their two families, one frame and column for each of "custom shapes" and "everything else". When adjusting a single selected object we use context to determine which column to show or hide. When editing multiple objects or the underlying graphic styles we show both columns. When editing a presentation style we show just the text box column. (The use of HasText in the original code is a concern, cause it doesn't make sense to me, using it like that means that in the original dialog format->text on an empty text box from F2 shows the contour option, but after entering text and then format->text it shows a set of different text box sizing options, so that's dropped here) Because (currently) the same SDRATTR_TEXT_AUTOGROWHEIGHT bit it used for two apparently different things then we visually toggle on all things that use that bit in multi-column mode when its togged on, i.e. on editing a style visually both "fit height to text" and "resize shape to fix text" are kept in sync when you toggle one or the other. We don't disable the "resize shape to fit text" checkbox (unlike the fit height to text checkbox which controls the same bit) if "fit to frame" and "adjust to contour" are set, and give it additional powers to unset those if clicked. This hopefully makes the ui describe the way things actually are. Because this SDRATTR_TEXT_AUTOGROWHEIGHT is currently sort of doing two purposes selecting a freshly drawn custom rectangle and using format->default formatting will cause it to change properties because the underlying SDRATTR_TEXT_AUTOGROWHEIGHT bit is cleared. The way things should probably be I guess is that there should be a SDRATTR_TEXT_AUTOGROWSIZE property (which used to exist but wasn't hooked up to anything) just for custom shapes which overrides the old family of options if set. Change-Id: I49241c90d919eeb5caa8775beab57746d5c6df04
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/prltempl.cxx5
-rw-r--r--sd/source/ui/dlg/tabtempl.cxx5
2 files changed, 8 insertions, 2 deletions
diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx
index 8c42ee3635e8..5bcccc558887 100644
--- a/sd/source/ui/dlg/prltempl.cxx
+++ b/sd/source/ui/dlg/prltempl.cxx
@@ -278,6 +278,11 @@ void SdPresLayoutTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
rPage.PageCreated(aSet);
}
+ else if (nId == mnTextAtt)
+ {
+ aSet.Put(CntUInt16Item(SID_SVXTEXTATTRPAGE_OBJKIND, OBJ_TEXT));
+ rPage.PageCreated(aSet);
+ }
}
const SfxItemSet* SdPresLayoutTemplateDlg::GetOutputItemSet() const
diff --git a/sd/source/ui/dlg/tabtempl.cxx b/sd/source/ui/dlg/tabtempl.cxx
index 1189922c4533..9a06ecef9cab 100644
--- a/sd/source/ui/dlg/tabtempl.cxx
+++ b/sd/source/ui/dlg/tabtempl.cxx
@@ -24,8 +24,10 @@
#include <svx/drawitem.hxx>
#include <svl/intitem.hxx>
#include <svx/ofaitem.hxx>
-#include <svx/svxgrahicitem.hxx>
+#include <svx/svdmark.hxx>
#include <svx/svdmodel.hxx>
+#include <svx/svdview.hxx>
+#include <svx/svxgrahicitem.hxx>
#include <svl/cjkoptions.hxx>
#include <svx/dialogs.hrc>
@@ -156,7 +158,6 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
}
else if (nId == m_nTextId)
{
- aSet.Put(OfaPtrItem(SID_SVXTEXTATTRPAGE_VIEW,pSdrView));
rPage.PageCreated(aSet);
}
else if (nId == m_nDimensionId)