summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh2.cxx
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2001-10-19 15:01:00 +0000
committerNiklas Nebel <nn@openoffice.org>2001-10-19 15:01:00 +0000
commit3a71fe4547f06e668630627017d022563069fed7 (patch)
tree5d5463a8d67d34c7d4b2e75891675bed2da06d6e /sc/source/ui/docshell/docsh2.cxx
parent9c7ec4164043f5ffc39aabbad6d2247b17c7d6cf (diff)
#87976# support setting for asian punctuation kerning
Diffstat (limited to 'sc/source/ui/docshell/docsh2.cxx')
-rw-r--r--sc/source/ui/docshell/docsh2.cxx59
1 files changed, 35 insertions, 24 deletions
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index a5ff01dea473..9007633f0e77 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docsh2.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: nn $ $Date: 2001-10-04 19:59:41 $
+ * last change: $Author: nn $ $Date: 2001-10-19 15:59:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -191,36 +191,47 @@ void ScDocShell::InitItems()
PutItem( SvxColorTableItem( OFF_APP()->GetStdColorTable() ) );
}
- if ( !aDocument.GetForbiddenCharacters().isValid() )
+ if ( !aDocument.GetForbiddenCharacters().isValid() ||
+ !aDocument.IsValidAsianCompression() || !aDocument.IsValidAsianKerning() )
{
- // set forbidden characters if necessary
- SvxAsianConfig aAsian;
- uno::Sequence<lang::Locale> aLocales = aAsian.GetStartEndCharLocales();
- if (aLocales.getLength())
- {
- vos::ORef<SvxForbiddenCharactersTable> xForbiddenTable =
- new SvxForbiddenCharactersTable( aDocument.GetServiceManager() );
+ // get settings from SvxAsianConfig
+ SvxAsianConfig aAsian( sal_False );
- const lang::Locale* pLocales = aLocales.getConstArray();
- for (sal_Int32 i = 0; i < aLocales.getLength(); i++)
+ if ( !aDocument.GetForbiddenCharacters().isValid() )
+ {
+ // set forbidden characters if necessary
+ uno::Sequence<lang::Locale> aLocales = aAsian.GetStartEndCharLocales();
+ if (aLocales.getLength())
{
- i18n::ForbiddenCharacters aForbidden;
- aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine );
- LanguageType eLang = SvxLocaleToLanguage(pLocales[i]);
- //pDoc->SetForbiddenCharacters( eLang, aForbidden );
+ vos::ORef<SvxForbiddenCharactersTable> xForbiddenTable =
+ new SvxForbiddenCharactersTable( aDocument.GetServiceManager() );
+
+ const lang::Locale* pLocales = aLocales.getConstArray();
+ for (sal_Int32 i = 0; i < aLocales.getLength(); i++)
+ {
+ i18n::ForbiddenCharacters aForbidden;
+ aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine );
+ LanguageType eLang = SvxLocaleToLanguage(pLocales[i]);
+ //pDoc->SetForbiddenCharacters( eLang, aForbidden );
+
+ xForbiddenTable->SetForbiddenCharacters( eLang, aForbidden );
+ }
- xForbiddenTable->SetForbiddenCharacters( eLang, aForbidden );
+ aDocument.SetForbiddenCharacters( xForbiddenTable );
}
+ }
- aDocument.SetForbiddenCharacters( xForbiddenTable );
+ if ( !aDocument.IsValidAsianCompression() )
+ {
+ // set compression mode from configuration if not already set (e.g. XML import)
+ aDocument.SetAsianCompression( aAsian.GetCharDistanceCompression() );
}
- }
- if ( !aDocument.IsValidAsianCompression() )
- {
- // set compression mode from configuration if not already set (e.g. XML import)
- SvxAsianConfig aAsian( sal_False ); //! share with forbidden characters
- aDocument.SetAsianCompression( aAsian.GetCharDistanceCompression() );
+ if ( !aDocument.IsValidAsianKerning() )
+ {
+ // set asian punctuation kerning from configuration if not already set (e.g. XML import)
+ aDocument.SetAsianKerning( !aAsian.IsKerningWesternTextOnly() ); // reversed
+ }
}
}