Commits

Malte Timmermann [mt]  committed bfb32e8

accfixes2: some cleanups...

  • Participants
  • Parent commits 224cd77

Comments (0)

Files changed (2)

File accessibility/source/helper/characterattributeshelper.cxx

 
 CharacterAttributesHelper::CharacterAttributesHelper( const Font& rFont, sal_Int32 nBackColor, sal_Int32 nColor )
 {
+	// MT: IA2 CWS commented out CharFontCharSet, CharFontFamily, CharFontPitch, CharFontStyleName, CharScaleWidth - any AT interested in this?
+
     m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharBackColor" ), makeAny( (sal_Int32) nBackColor ) ) );
     m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharColor" ), makeAny( (sal_Int32) nColor ) ) );
     m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharFontCharSet" ), makeAny( (sal_Int16) rFont.GetCharSet() ) ) );
     m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharStrikeout" ), makeAny( (sal_Int16) rFont.GetStrikeout() ) ) );
     m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharUnderline" ), makeAny( (sal_Int16) rFont.GetUnderline() ) ) );
     m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharWeight" ), makeAny( (float) rFont.GetWeight() ) ) );
+    m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharPosture" ), makeAny( (sal_Int16)rFont.GetItalic() ) ) );
+	// MT: Introduced with IA2 CWS, but adjustment is not a char attr...
+    // m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "ParaAdjust" ), makeAny( nAjust ) ) );
 }
 
 // -----------------------------------------------------------------------------

File accessibility/source/standard/vclxaccessibletextcomponent.cxx

 
     if ( GetWindow() )
     {
-        Font aFont = GetWindow()->GetControlFont();
-        sal_Int32 nBackColor = GetWindow()->GetControlBackground().GetColor();
-        sal_Int32 nColor = GetWindow()->GetControlForeground().GetColor();
-        ::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) );
+		Font aFont = GetWindow()->GetControlFont();
+
+		sal_Int32 nBackColor = GetWindow()->GetControlBackground().GetColor();
+		sal_Int32 nColor = GetWindow()->GetControlForeground().GetColor();
+
+		// MT: Code with default font was introduced with the IA2 CWS, but I am not convinced that this is the correct font...
+		// Decide what to do when we have a concrete issue.
+		/*
+		Font aDefaultVCLFont;
+		OutputDevice* pDev = Application::GetDefaultDevice();
+		if ( pDev )
+		{	
+			aDefaultVCLFont = pDev->GetSettings().GetStyleSettings().GetAppFont();
+			if ( !aFont.GetName().Len() )
+			{
+				String aDefaultName = aDefaultVCLFont.GetName();
+				aFont.SetName( aDefaultName );
+			}
+			if ( !aFont.GetHeight() )
+			{
+				aFont.SetHeight( aDefaultVCLFont.GetHeight() );
+			}
+			if ( aFont.GetWeight() == WEIGHT_DONTKNOW )
+			{
+				aFont.SetWeight( aDefaultVCLFont.GetWeight() );
+			}
+
+			//if nColor is -1, it may indicate that the default color black is using.
+			if ( nColor == -1)
+			{
+				nColor = aDefaultVCLFont.GetColor().GetColor();
+			}
+		}
+		*/
+
+		// MT: Adjustment stuff was introduced with the IA2 CWS, but adjustment is not a character attribute...
+		// In case we reintroduce it, use adjustment as extra parameter for the CharacterAttributesHelper...
+		/*
+		WinBits aBits = GetWindow()->GetStyle();
+		sal_Int16 nAdjust = -1;
+		if ( aBits & WB_LEFT )
+		{
+			nAdjust = style::ParagraphAdjust_LEFT;
+		}
+		else if ( aBits & WB_RIGHT )
+		{
+			nAdjust = style::ParagraphAdjust_RIGHT;
+		}
+		else if ( aBits & WB_CENTER )
+		{
+			nAdjust = style::ParagraphAdjust_CENTER;
+		}
+		*/
+
+		::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) );
+		
 		aValues = pHelper->GetCharacterAttributes( aRequestedAttributes );
     }