Kaydet (Commit) 0ed4da1a authored tarafından Muthu Subramanian's avatar Muthu Subramanian

n#657905: Display the scaled fontsize in the toolbar.

Initial set of changes to improve UX for autofit.
üst be5587ce
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <editeng/outlobj.hxx> #include <editeng/outlobj.hxx>
#include <editeng/writingmodeitem.hxx> #include <editeng/writingmodeitem.hxx>
#include <editeng/frmdiritem.hxx> #include <editeng/frmdiritem.hxx>
#include <editeng/fhgtitem.hxx>
#include <sfx2/objface.hxx> #include <sfx2/objface.hxx>
...@@ -155,6 +156,8 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) ...@@ -155,6 +156,8 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
case SID_ATTR_CHAR_WEIGHT: case SID_ATTR_CHAR_WEIGHT:
case SID_ATTR_CHAR_POSTURE: case SID_ATTR_CHAR_POSTURE:
{ {
sal_uInt16 stretchX = 100;
sal_uInt16 stretchY = 100;
SvxScriptSetItem aSetItem( nSlotId, GetPool() ); SvxScriptSetItem aSetItem( nSlotId, GetPool() );
aSetItem.GetItemSet().Put( aAttrSet, sal_False ); aSetItem.GetItemSet().Put( aAttrSet, sal_False );
...@@ -165,6 +168,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) ...@@ -165,6 +168,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
// input language should be preferred over // input language should be preferred over
// current cursor position to detect script type // current cursor position to detect script type
OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
SdrOutliner *pOutliner = mpView->GetTextEditOutliner();
if (mpView->ISA(OutlineView)) if (mpView->ISA(OutlineView))
{ {
...@@ -172,6 +176,9 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) ...@@ -172,6 +176,9 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
mpViewShell->GetActiveWindow()); mpViewShell->GetActiveWindow());
} }
if( pOutliner )
pOutliner->GetGlobalCharStretching( stretchX, stretchY );
if(pOLV && !pOLV->GetSelection().HasRange()) if(pOLV && !pOLV->GetSelection().HasRange())
{ {
if( mpViewShell && mpViewShell->GetViewShell() && mpViewShell->GetViewShell()->GetWindow() ) if( mpViewShell && mpViewShell->GetViewShell() && mpViewShell->GetViewShell()->GetWindow() )
...@@ -185,9 +192,22 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) ...@@ -185,9 +192,22 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType ); const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
if( pI ) 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 else
{
aAttrSet.InvalidateItem( nWhich ); aAttrSet.InvalidateItem( nWhich );
}
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment