diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-03-07 23:50:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-03-08 12:02:37 +0000 |
commit | 5b395625901b1f9c2314a0b9a13f4876a3ae17ce (patch) | |
tree | 42f91df0ee35f2a55bac7da11442a4273c32b445 /sd | |
parent | 14c4c26cea838b3fffb0b17ba440c29a6066fad1 (diff) |
de-uno-ize ScriptTypeDetector
leave a UnoScriptTypeDetector implementation that points to the
trivial ScriptTypeDetector for external consumers, e.g. sdext
Diffstat (limited to 'sd')
-rw-r--r-- | sd/CppunitTest_sd_filters_test.mk | 1 | ||||
-rw-r--r-- | sd/Library_sdfilt.mk | 1 | ||||
-rw-r--r-- | sd/source/filter/eppt/epptbase.hxx | 2 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-text.cxx | 26 |
4 files changed, 10 insertions, 20 deletions
diff --git a/sd/CppunitTest_sd_filters_test.mk b/sd/CppunitTest_sd_filters_test.mk index 193343952c78..647c45c1cd3b 100644 --- a/sd/CppunitTest_sd_filters_test.mk +++ b/sd/CppunitTest_sd_filters_test.mk @@ -43,6 +43,7 @@ $(eval $(call gb_CppunitTest_add_linked_libs,sd_filters_test, \ editeng \ fileacc \ i18nisolang1 \ + i18nutil \ msfilter \ oox \ sal \ diff --git a/sd/Library_sdfilt.mk b/sd/Library_sdfilt.mk index b3e74ffddb93..585dc9e0451d 100644 --- a/sd/Library_sdfilt.mk +++ b/sd/Library_sdfilt.mk @@ -53,6 +53,7 @@ $(eval $(call gb_Library_add_linked_libs,sdfilt,\ cppuhelper \ editeng \ i18nisolang1 \ + i18nutil \ msfilter \ oox \ sal \ diff --git a/sd/source/filter/eppt/epptbase.hxx b/sd/source/filter/eppt/epptbase.hxx index 33a43d364fd7..c2bb4e31189e 100644 --- a/sd/source/filter/eppt/epptbase.hxx +++ b/sd/source/filter/eppt/epptbase.hxx @@ -190,7 +190,7 @@ public : ~FontCollection(); - short GetScriptDirection( const String& rText ) const; + short GetScriptDirection( const rtl::OUString& rText ) const; sal_uInt32 GetId( FontCollectionEntry& rFontDescriptor ); diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 38485286f9aa..e53b0c2230a9 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -37,7 +37,6 @@ #include <com/sun/star/i18n/XBreakIterator.hpp> #include <com/sun/star/i18n/ScriptDirection.hpp> #include <com/sun/star/i18n/ScriptType.hpp> -#include <com/sun/star/i18n/XScriptTypeDetector.hpp> #include <com/sun/star/text/FontRelief.hpp> #include <com/sun/star/text/XTextField.hpp> #include <com/sun/star/text/XTextRange.hpp> @@ -46,19 +45,19 @@ #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/style/TabStop.hpp> -#include <svl/languageoptions.hxx> -#include <sfx2/app.hxx> +#include <comphelper/processfactory.hxx> #include <editeng/svxenum.hxx> #include <editeng/frmdir.hxx> +#include <i18nutil/scripttypedetector.hxx> +#include <sfx2/app.hxx> +#include <svl/languageoptions.hxx> +#include <oox/export/drawingml.hxx> // for SubstituteBullet #include <unotools/fontcvt.hxx> #include <vcl/metric.hxx> #include <vcl/outdev.hxx> #include <vcl/virdev.hxx> -#include <comphelper/processfactory.hxx> -#include <oox/export/drawingml.hxx> // for SubstituteBullet com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > xPPTBreakIter; -com::sun::star::uno::Reference< com::sun::star::i18n::XScriptTypeDetector > xScriptTypeDetector; PortionObj::PortionObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, FontCollection& rFontCollection ) : @@ -1339,7 +1338,6 @@ FontCollection::~FontCollection() { delete pVDev; xPPTBreakIter = NULL; - xScriptTypeDetector = NULL; } FontCollection::FontCollection() : @@ -1352,21 +1350,11 @@ FontCollection::FontCollection() : if ( xInterface.is() ) xPPTBreakIter = com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > ( xInterface, com::sun::star::uno::UNO_QUERY ); - - xInterface = xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.i18n.ScriptTypeDetector" ) ) ); - if ( xInterface.is() ) - xScriptTypeDetector = com::sun::star::uno::Reference< com::sun::star::i18n::XScriptTypeDetector > - ( xInterface, com::sun::star::uno::UNO_QUERY ); } -short FontCollection::GetScriptDirection( const String& rString ) const +short FontCollection::GetScriptDirection( const rtl::OUString& rString ) const { - short nRet = com::sun::star::i18n::ScriptDirection::NEUTRAL; - if ( xScriptTypeDetector.is() ) - { - const rtl::OUString sT( rString ); - nRet = xScriptTypeDetector->getScriptDirection( sT, 0, com::sun::star::i18n::ScriptDirection::NEUTRAL ); - } + short nRet = ScriptTypeDetector::getScriptDirection( rString, 0, com::sun::star::i18n::ScriptDirection::NEUTRAL ); return nRet; } |