diff options
author | Muthu Subramanian <sumuthu@suse.com> | 2013-03-07 18:17:01 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@suse.com> | 2013-03-22 13:18:33 +0530 |
commit | a5fdee6020d13bba6145dcbb7b83a9ceef4a0fe7 (patch) | |
tree | 6de431fff37f2fddd0a0c49002889d5bc664d92c | |
parent | c56f5aca62ccc8a641f3eaa304d9c1ff004c0ea6 (diff) |
n#657905: Display the scaled fontsize in the toolbar.
Initial set of changes to improve UX for autofit.
-rw-r--r-- | sd/source/ui/view/drtxtob.cxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index e124fcc735e5..4bb15ebf6006 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -54,6 +54,7 @@ #include <editeng/outlobj.hxx> #include <editeng/writingmodeitem.hxx> #include <editeng/frmdiritem.hxx> +#include <editeng/fhgtitem.hxx> #include <sfx2/objface.hxx> @@ -179,6 +180,8 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) case SID_ATTR_CHAR_WEIGHT: case SID_ATTR_CHAR_POSTURE: { + sal_uInt16 stretchX = 100; + sal_uInt16 stretchY = 100; SvxScriptSetItem aSetItem( nSlotId, GetPool() ); aSetItem.GetItemSet().Put( aAttrSet, sal_False ); @@ -189,6 +192,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) // input language should be preferred over // current cursor position to detect script type OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); + SdrOutliner *pOutliner = mpView->GetTextEditOutliner(); if (mpView->ISA(OutlineView)) { @@ -196,6 +200,9 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) mpViewShell->GetActiveWindow()); } + if( pOutliner ) + pOutliner->GetGlobalCharStretching( stretchX, stretchY ); + if(pOLV && !pOLV->GetSelection().HasRange()) { if( mpViewShell && mpViewShell->GetViewShell() && mpViewShell->GetViewShell()->GetWindow() ) @@ -209,9 +216,22 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType ); if( pI ) - aAttrSet.Put( *pI, nWhich ); + { + if( nSlotId == SID_ATTR_CHAR_FONTHEIGHT ) + { + SvxFontHeightItem aFontItem = *(dynamic_cast<const SvxFontHeightItem *>(pI)); + aFontItem.SetHeight(aFontItem.GetHeight(), stretchX, aFontItem.GetPropUnit()); + aAttrSet.Put( aFontItem, nWhich ); + } + else + { + aAttrSet.Put( *pI, nWhich ); + } + } else + { aAttrSet.InvalidateItem( nWhich ); + } } break; |