summaryrefslogtreecommitdiff
path: root/cui/source/options/optgdlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/options/optgdlg.cxx')
-rw-r--r--cui/source/options/optgdlg.cxx90
1 files changed, 81 insertions, 9 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index b9a181a28438..d070122db985 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,6 +41,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/mnemonic.hxx>
#include <i18npool/mslangid.hxx>
+#include <unotools/compatibility.hxx>
#include <unotools/useroptions.hxx>
#include <unotools/cacheoptions.hxx>
#include <unotools/fontoptions.hxx>
@@ -76,6 +78,7 @@
#include <dialmgr.hxx>
#include <svtools/helpopt.hxx>
#include <unotools/saveopt.hxx>
+#include <sal/macros.h>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -204,10 +207,12 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
aFileDlgFL ( this, CUI_RES( FL_FILEDLG ) ),
aFileDlgROImage ( this, CUI_RES( FI_FILEDLG_RO ) ),
aFileDlgCB ( this, CUI_RES( CB_FILEDLG ) ),
+ aODMADlgCB ( this, CUI_RES( CB_ODMADLG ) ),
aPrintDlgFL ( this, CUI_RES( FL_PRINTDLG ) ),
aPrintDlgCB ( this, CUI_RES( CB_PRINTDLG ) ),
aDocStatusFL ( this, CUI_RES( FL_DOCSTATUS ) ),
aDocStatusCB ( this, CUI_RES( CB_DOCSTATUS ) ),
+ aSaveAlwaysCB ( this, CUI_RES( CB_SAVE_ALWAYS ) ),
aTwoFigureFL ( this, CUI_RES( FL_TWOFIGURE ) ),
aInterpretFT ( this, CUI_RES( FT_INTERPRET ) ),
aYearValueField ( this, CUI_RES( NF_YEARVALUE ) ),
@@ -227,6 +232,31 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
aPrintDlgCB.Hide();
#endif
+#ifdef WNT
+ aFileDlgCB.SetToggleHdl( LINK( this, OfaMiscTabPage, OnFileDlgToggled ) );
+#else
+ {
+ aODMADlgCB.Hide();
+ // rearrange the following controls
+ Point aNewPos = aDocStatusFL.GetPosPixel();
+ long nDelta = aNewPos.Y() - aODMADlgCB.GetPosPixel().Y();
+
+ Window* pWins[] =
+ {
+ &aDocStatusFL, &aDocStatusCB, &aSaveAlwaysCB, &aTwoFigureFL,
+ &aInterpretFT, &aYearValueField, &aToYearFT
+ };
+ Window** pCurrent = pWins;
+ const sal_Int32 nCount = SAL_N_ELEMENTS( pWins );
+ for ( sal_Int32 i = 0; i < nCount; ++i, ++pCurrent )
+ {
+ aNewPos = (*pCurrent)->GetPosPixel();
+ aNewPos.Y() -= nDelta;
+ (*pCurrent)->SetPosPixel( aNewPos );
+ }
+ }
+#endif
+
if ( !aFileDlgCB.IsVisible() )
{
// rearrange the following controls
@@ -235,11 +265,11 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
Window* pWins[] =
{
- &aPrintDlgFL, &aPrintDlgCB, &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
- &aInterpretFT, &aYearValueField, &aToYearFT
+ &aPrintDlgFL, &aPrintDlgCB, &aDocStatusFL, &aDocStatusCB, &aSaveAlwaysCB,
+ &aTwoFigureFL, &aInterpretFT, &aYearValueField, &aToYearFT
};
Window** pCurrent = pWins;
- const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[ 0 ] );
+ const sal_Int32 nCount = SAL_N_ELEMENTS( pWins );
for ( sal_Int32 i = 0; i < nCount; ++i, ++pCurrent )
{
aNewPos = (*pCurrent)->GetPosPixel();
@@ -261,11 +291,11 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
Window* pWins[] =
{
- &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
+ &aDocStatusFL, &aDocStatusCB, &aSaveAlwaysCB, &aTwoFigureFL,
&aInterpretFT, &aYearValueField, &aToYearFT
};
Window** pCurrent = pWins;
- const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[ 0 ] );
+ const sal_Int32 nCount = SAL_N_ELEMENTS( pWins );
for ( sal_Int32 i = 0; i < nCount; ++i, ++pCurrent )
{
aNewPos = (*pCurrent)->GetPosPixel();
@@ -316,6 +346,14 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
}
}
+#ifdef WNT
+IMPL_LINK( OfaMiscTabPage, OnFileDlgToggled, CheckBox*, EMPTYARG )
+{
+ aODMADlgCB.Enable( !aFileDlgCB.IsChecked() );
+ return 0;
+}
+#endif
+
// -----------------------------------------------------------------------
OfaMiscTabPage::~OfaMiscTabPage()
@@ -370,6 +408,13 @@ BOOL OfaMiscTabPage::FillItemSet( SfxItemSet& rSet )
bModified = TRUE;
}
+ if ( aODMADlgCB.IsChecked() != aODMADlgCB.GetSavedValue() )
+ {
+ SvtMiscOptions aMiscOpt;
+ aMiscOpt.SetTryODMADialog( aODMADlgCB.IsChecked() );
+ bModified = TRUE;
+ }
+
if ( aDocStatusCB.IsChecked() != aDocStatusCB.GetSavedValue() )
{
SvtPrintWarningOptions aPrintOptions;
@@ -377,6 +422,13 @@ BOOL OfaMiscTabPage::FillItemSet( SfxItemSet& rSet )
bModified = TRUE;
}
+ if ( aSaveAlwaysCB.IsChecked() != aSaveAlwaysCB.GetSavedValue() )
+ {
+ SvtMiscOptions aMiscOpt;
+ aMiscOpt.SetSaveAlwaysAllowed( aSaveAlwaysCB.IsChecked() );
+ bModified = TRUE;
+ }
+
const SfxUInt16Item* pUInt16Item =
PTR_CAST( SfxUInt16Item, GetOldItem( rSet, SID_ATTR_YEAR2000 ) );
USHORT nNum = (USHORT)aYearValueField.GetText().ToInt32();
@@ -418,6 +470,11 @@ void OfaMiscTabPage::Reset( const SfxItemSet& rSet )
aFileDlgCB.SaveValue();
aPrintDlgCB.Check( !aMiscOpt.UseSystemPrintDialog() );
aPrintDlgCB.SaveValue();
+ aSaveAlwaysCB.Check( aMiscOpt.IsSaveAlwaysAllowed() );
+ aSaveAlwaysCB.SaveValue();
+
+ aODMADlgCB.Check( aMiscOpt.TryODMADialog() );
+ aODMADlgCB.SaveValue();
SvtPrintWarningOptions aPrintOptions;
aDocStatusCB.Check(aPrintOptions.IsModifyDocumentOnPrintingAllowed());
@@ -747,7 +804,7 @@ OfaViewTabPage::OfaViewTabPage(Window* pParent, const SfxItemSet& rSet ) :
DELETEZ( pFontAntiAliasing );
Point aPos;
- for ( sal_Int32 i = 0; i < sizeof( pMiscOptions ) / sizeof( pMiscOptions[0] ); ++i )
+ for ( sal_Int32 i = 0; i < SAL_N_ELEMENTS( pMiscOptions ); ++i )
{
aPos = pMiscOptions[i]->GetPosPixel( );
aPos.Y() -= nMoveUp;
@@ -1455,9 +1512,18 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
pLangConfig->aLanguageOptions.BlockBroadcasts( TRUE );
pLangConfig->aLinguConfig.BlockBroadcasts( TRUE );
- if(aCTLSupportCB.IsChecked() &&
- (aCTLSupportCB.GetSavedValue() != aCTLSupportCB.IsChecked()) ||
- (aComplexLanguageLB.GetSavedValue() != aComplexLanguageLB.GetSelectEntryPos()))
+ /*
+ * Sequence checking only matters when CTL support is enabled.
+ *
+ * So we only need to check for sequence checking if
+ * a) previously it was unchecked and is now checked or
+ * b) it was already checked but the CTL language has changed
+ */
+ if (
+ aCTLSupportCB.IsChecked() &&
+ (aCTLSupportCB.GetSavedValue() != STATE_CHECK ||
+ aComplexLanguageLB.GetSavedValue() != aComplexLanguageLB.GetSelectEntryPos())
+ )
{
//sequence checking has to be switched on depending on the selected CTL language
LanguageType eCTLLang = aComplexLanguageLB.GetSelectLanguage();
@@ -1543,6 +1609,11 @@ BOOL OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
// the end of this method
pLangConfig->aSysLocaleOptions.SetLocaleConfigString( sNewLang );
rSet.Put( SfxBoolItem( SID_OPT_LOCALE_CHANGED, TRUE ) );
+
+ sal_uInt16 nNewType = SvtLanguageOptions::GetScriptTypeOfLanguage( eNewLocale );
+ bool bNewCJK = ( nNewType & SCRIPTTYPE_ASIAN ) != 0;
+ SvtCompatibilityOptions aCompatOpts;
+ aCompatOpts.SetDefault( COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE, !bNewCJK );
}
if(aDecimalSeparatorCB.GetSavedValue() != aDecimalSeparatorCB.IsChecked())
@@ -1917,3 +1988,4 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */