[ooo-build-commit] .: unotools/inc unotools/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Tue Sep 14 08:29:42 PDT 2010
unotools/inc/unotools/compatibility.hxx | 2 +
unotools/source/config/compatibility.cxx | 40 +++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
New commits:
commit 0d5aa08642520d2818e490fcf1b56fb7506b5fd1
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Tue Sep 14 17:21:03 2010 +0200
cjk-default-compatibility.diff: Don't expand spaces with manual breaks
i#54320
diff --git a/unotools/inc/unotools/compatibility.hxx b/unotools/inc/unotools/compatibility.hxx
index 11aeffc..65e92fa 100644
--- a/unotools/inc/unotools/compatibility.hxx
+++ b/unotools/inc/unotools/compatibility.hxx
@@ -153,6 +153,8 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options
void Clear();
+ void SetDefault( ::rtl::OUString sName, bool bValue );
+
/*-****************************************************************************************************//**
@short return complete specified list
@descr Call it to get all entries of compatibility options.
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx
index e502860..4640cf9 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -35,6 +35,7 @@
#include <unotools/compatibility.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/configitem.hxx>
+#include <unotools/syslocale.hxx>
#include <tools/debug.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -247,6 +248,8 @@ class SvtCompatibilityOptions_Impl : public ConfigItem
SvtCompatibilityOptions_Impl();
~SvtCompatibilityOptions_Impl();
+ void SetDefault( OUString sName, bool bValue );
+
//---------------------------------------------------------------------------------------------------------
// overloaded methods of baseclass
//---------------------------------------------------------------------------------------------------------
@@ -425,6 +428,12 @@ SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl()
if ( !bDefaultFound && aItem.sName.equals( COMPATIBILITY_DEFAULT_NAME ) != sal_False )
{
+ SvtSysLocale aSysLocale;
+ com::sun::star::lang::Locale aLocale = aSysLocale.GetLocale();
+ if ( aLocale.Language.equalsAscii( "zh" ) || aLocale.Language.equalsAscii( "ja" ) ||
+ aLocale.Language.equalsAscii( "ko" ) )
+ aItem.bExpandWordSpace = false;
+
m_aDefOptions = aItem;
bDefaultFound = true;
}
@@ -443,6 +452,32 @@ SvtCompatibilityOptions_Impl::~SvtCompatibilityOptions_Impl()
}
}
+void SvtCompatibilityOptions_Impl::SetDefault( OUString sName, bool bValue )
+{
+ if ( COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS.equals( sName ) )
+ m_aDefOptions.SetUsePrtMetrics( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_ADDSPACING.equals( sName ) )
+ m_aDefOptions.SetAddSpacing( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_ADDSPACINGATPAGES.equals( sName ) )
+ m_aDefOptions.SetAddSpacingAtPages( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_USEOURTABSTOPS.equals( sName ) )
+ m_aDefOptions.SetUseOurTabStops( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_NOEXTLEADING.equals( sName ) )
+ m_aDefOptions.SetNoExtLeading( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_USELINESPACING.equals( sName ) )
+ m_aDefOptions.SetUseLineSpacing( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_ADDTABLESPACING.equals( sName ) )
+ m_aDefOptions.SetAddTableSpacing( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_USEOBJECTPOSITIONING.equals( sName ) )
+ m_aDefOptions.SetUseObjPos( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_USEOURTEXTWRAPPING.equals( sName ) )
+ m_aDefOptions.SetUseOurTextWrapping( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE.equals( sName ) )
+ m_aDefOptions.SetConsiderWrappingStyle( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE.equals( sName ) )
+ m_aDefOptions.SetExpandWordSpace( bValue );
+}
+
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
@@ -680,6 +715,11 @@ void SvtCompatibilityOptions::Clear()
m_pDataContainer->Clear();
}
+void SvtCompatibilityOptions::SetDefault( ::rtl::OUString sName, bool bValue )
+{
+ m_pDataContainer->SetDefault( sName, bValue );
+}
+
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
More information about the ooo-build-commit
mailing list