summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2013-03-07 18:17:01 +0530
committerMuthu Subramanian <sumuthu@suse.com>2013-04-01 19:25:51 +0530
commitdef57902b4913417d7c5fef3b00782de9eb7e9d1 (patch)
tree283645dcafc653f5722843b4001b78e2210f6e68 /sd
parenta95145e52da0f887f3cf96b515681371e76fa4a6 (diff)
n#657905: Display the scaled fontsize in the toolbar.
Initial set of changes to improve UX for autofit.
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/drtxtob.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 7980f144de0b..e659b10698e2 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -45,6 +45,7 @@
#include <editeng/outlobj.hxx>
#include <editeng/writingmodeitem.hxx>
#include <editeng/frmdiritem.hxx>
+#include <editeng/fhgtitem.hxx>
#include <sfx2/objface.hxx>
@@ -170,6 +171,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 );
@@ -180,6 +183,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))
{
@@ -187,6 +191,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() )
@@ -200,9 +207,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;