summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2005-11-02 08:57:06 +0000
committerKurt Zenker <kz@openoffice.org>2005-11-02 08:57:06 +0000
commit02b36fcfe3e31f30cb34a145be6609930c406687 (patch)
tree0ee4d70601810161ab9bb68a074e49eb5a480460 /svx
parent4dc2a8a0ded1711643102b2051ef152cb0ead28d (diff)
INTEGRATION: CWS sj29 (1.10.42); FILE MERGED
2005/10/25 17:48:14 sj 1.10.42.1: #i55538# now using the correct font by supporting the script type
Diffstat (limited to 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx46
1 files changed, 40 insertions, 6 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 97a941804f..c48307d444 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: EnhancedCustomShapeFontWork.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: kz $ $Date: 2005-10-05 13:23:01 $
+ * last change: $Author: kz $ $Date: 2005-11-02 09:57:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -118,9 +118,6 @@
#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
#endif
-#ifndef _COM_SUN_STAR_I18N_XBREAKITERATOR_HPP_
-#include <com/sun/star/i18n/XBreakIterator.hpp>
-#endif
#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#endif
@@ -306,7 +303,27 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
if ( rText.getLength() )
{
// generating vcl/font
- SvxFontItem& rFontItem = (SvxFontItem&)pCustomShape->GetMergedItem( EE_CHAR_FONTINFO );
+ USHORT nScriptType = i18n::ScriptType::LATIN;
+ Reference< i18n::XBreakIterator > xBI( EnhancedCustomShapeFontWork::GetBreakIterator() );
+ if ( xBI.is() )
+ {
+ nScriptType = xBI->getScriptType( rText, 0 );
+ sal_uInt16 nChg = 0;
+ if( i18n::ScriptType::WEAK == nScriptType )
+ {
+ nChg = (xub_StrLen)xBI->endOfScript( rText, nChg, nScriptType );
+ if( nChg < rText.getLength() )
+ nScriptType = xBI->getScriptType( rText, nChg );
+ else
+ nScriptType = i18n::ScriptType::LATIN;
+ }
+ }
+ UINT16 nFntItm = EE_CHAR_FONTINFO;
+ if ( nScriptType == i18n::ScriptType::COMPLEX )
+ nFntItm = EE_CHAR_FONTINFO_CTL;
+ else if ( nScriptType == i18n::ScriptType::ASIAN )
+ nFntItm = EE_CHAR_FONTINFO_CJK;
+ SvxFontItem& rFontItem = (SvxFontItem&)pCustomShape->GetMergedItem( nFntItm );
Font aFont;
aFont.SetHeight( rFWData.nSingleLineHeight );
aFont.SetAlign( ALIGN_TOP );
@@ -928,6 +945,23 @@ SdrObject* CreateSdrObjectFromParagraphOutlines( const FWData& rFWData, const Sd
return pRet;
}
+::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > EnhancedCustomShapeFontWork::mxBreakIterator = 0;
+
+Reference < i18n::XBreakIterator > EnhancedCustomShapeFontWork::GetBreakIterator()
+{
+ if ( !mxBreakIterator.is() )
+ {
+ Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ Reference < XInterface > xI = xMSF->createInstance( rtl::OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) );
+ if ( xI.is() )
+ {
+ Any x = xI->queryInterface( ::getCppuType((const Reference< i18n::XBreakIterator >*)0) );
+ x >>= mxBreakIterator;
+ }
+ }
+ return mxBreakIterator;
+}
+
SdrObject* EnhancedCustomShapeFontWork::CreateFontWork( const SdrObject* pShape2d, const SdrObject* pCustomShape )
{
SdrObject* pRet = NULL;