diff options
author | Oliver Specht <os@openoffice.org> | 2000-09-28 14:25:03 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2000-09-28 14:25:03 +0000 |
commit | d9ef81c0637770a66e69951da82a7600862c563c (patch) | |
tree | 007f8c79b3c7b057f44ff92a69708dccf7597cea /sw/source | |
parent | dbe6385ad4c4fdb98034fdcc79e802dfd16dac14 (diff) |
use of configuration service in view options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/ui/app/apphdl.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/app/appopt.cxx | 15 | ||||
-rw-r--r-- | sw/source/ui/app/docshini.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/app/swmodul1.cxx | 250 | ||||
-rw-r--r-- | sw/source/ui/config/modcfg.cxx | 39 | ||||
-rw-r--r-- | sw/source/ui/config/optload.cxx | 23 | ||||
-rw-r--r-- | sw/source/ui/config/usrpref.cxx | 960 | ||||
-rw-r--r-- | sw/source/ui/inc/usrpref.hxx | 126 | ||||
-rw-r--r-- | sw/source/ui/uiview/pview.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewmdi.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/utlui/uitool.cxx | 34 |
11 files changed, 572 insertions, 923 deletions
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index cf78e5ec1c6e..1d8ffc1780e3 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: apphdl.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:31 $ + * last change: $Author: os $ $Date: 2000-09-28 15:22:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -721,13 +721,11 @@ void SwModule::ExecViewOptions(SfxRequest &rReq) // fuer die Initialisierung if(!pWebUsrPref) GetUsrPref(sal_True); - pWebUsrPref->SetDefault( sal_False ); } else { if(!pUsrPref) GetUsrPref(sal_False); - pUsrPref->SetDefault( sal_False ); } SW_MOD()->CheckSpellChanges( pOpt->IsOnlineSpell(), sal_False, sal_False ); @@ -1075,25 +1073,27 @@ SwSrcViewConfig* SwModule::GetSourceViewConfig() /*-----------------30.01.97 08.30------------------- --------------------------------------------------*/ -const SwMasterUsrPref *SwModule::GetUsrPref(sal_Bool bWeb) +const SwMasterUsrPref *SwModule::GetUsrPref(sal_Bool bWeb) const { + SwModule* pNonConstModule = (SwModule*)this; if(bWeb && !pWebUsrPref) { // im Load der SwMasterUsrPref wird der SpellChecker gebraucht, dort darf // er aber nicht angelegt werden #58256# - pWebUsrPref = new SwMasterUsrPref(CFG_SWWEB_USRPREF); - pWebUsrPref->Initialize(); + pNonConstModule->pWebUsrPref = new SwMasterUsrPref(TRUE); } else if(!bWeb && !pUsrPref) { - pUsrPref = new SwMasterUsrPref(CFG_USERPREF_ITEM); - pUsrPref->Initialize(); + pNonConstModule->pUsrPref = new SwMasterUsrPref(FALSE); } return bWeb ? pWebUsrPref : pUsrPref; } /*------------------------------------------------------------------------- $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:31 hr + initial import + Revision 1.289 2000/09/18 16:05:09 willem.vandorp OpenOffice header added. diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index 2bf010ccd4ba..8cb3bc9ab8d9 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: appopt.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:31 $ + * last change: $Author: os $ $Date: 2000-09-28 15:22:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -151,6 +151,7 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) // hier werden die Optionen fuer die Web- und den Textdialog zusmmengesetzt SwViewOption aViewOpt = *GetUsrPref(!bTextDialog); + SwMasterUsrPref* pPref = bTextDialog ? pUsrPref : pWebUsrPref; BOOL bFrameDoc = FALSE; //kein MakeUsrPref, da hier nur die Optionen von Textdoks genommen werden duerfen SwView* pAppView = GetView(); @@ -233,8 +234,7 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) pRet->Put(aBool); } - SwModuleOptions* pMCfg = GetModuleConfig(); - pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, pMCfg->GetMetric(!bTextDialog))); + pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, pPref->GetMetric())); if(bTextDialog) { if(pAppView) @@ -245,7 +245,7 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, (USHORT)::GetTabDist(rDefTabs))); } else - pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, pMCfg->GetDefTab())); + pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, pPref->GetDefTab())); } /*-----------------01.02.97 11.13------------------- @@ -368,7 +368,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) FALSE, &pItem ) ) { USHORT nTabDist = ((const SfxUInt16Item*)pItem)->GetValue(); - pMCfg->SetDefTab(nTabDist); + pUsrPref->SetDefTab(nTabDist); if(pAppView) { SvxTabStopItem aDefTabs( 0, 0 ); @@ -545,6 +545,9 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItem /*------------------------------------------------------------------------- $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:31 hr + initial import + Revision 1.163 2000/09/18 16:05:10 willem.vandorp OpenOffice header added. diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index b223e6e369a2..632ae21993e6 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docshini.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:31 $ + * last change: $Author: os $ $Date: 2000-09-28 15:22:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -766,7 +766,7 @@ void SwDocShell::SubInitNew() aHyp.GetMinTrail() = sal_Int8(nVal); aDfltSet.Put( aHyp ); - sal_uInt16 nNewPos = SW_MOD()->GetModuleConfig()->GetDefTab(); + sal_uInt16 nNewPos = SW_MOD()->GetUsrPref(FALSE)->GetDefTab(); if( nNewPos ) aDfltSet.Put( SvxTabStopItem( 1, nNewPos, SVX_TAB_ADJUST_DEFAULT ) ); @@ -777,6 +777,9 @@ void SwDocShell::SubInitNew() /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:31 hr + initial import + Revision 1.209 2000/09/18 16:05:11 willem.vandorp OpenOffice header added. diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index 6d1e3a224f92..aa72d3ab4213 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swmodul1.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:31 $ + * last change: $Author: os $ $Date: 2000-09-28 15:22:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -475,8 +475,8 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView, if(!bViewOnly) { - pPref->SetDefault( sal_False ); pPref->SetUsrPref( rUsrPref ); + pPref->SetModified(); } if( !pView ) @@ -512,6 +512,42 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView, pPref->SetIdle(sal_True); } +/* -----------------------------28.09.00 12:36-------------------------------- + + ---------------------------------------------------------------------------*/ +void SwModule::ApplyUserMetric( FieldUnit eMetric, BOOL bWeb ) +{ + SwMasterUsrPref* pPref; + if(bWeb) + { + if(!pWebUsrPref) + GetUsrPref(sal_True); + pPref = pWebUsrPref; + } + else + { + if(!pUsrPref) + GetUsrPref(sal_False); + pPref = pUsrPref; + } + FieldUnit eOldMetric = pPref->GetMetric(); + if(eOldMetric != eMetric) + pPref->SetMetric(eMetric); + + SwView* pTmpView = SwModule::GetFirstView(); + // fuer alle MDI-Fenster das Lineal umschalten + while(pTmpView) + { + if(bWeb == (0 != PTR_CAST(SwWebView, pTmpView))) + { + pTmpView->ChangeVLinealMetric(eMetric); + pTmpView->ChangeTabMetric(eMetric); + } + + pTmpView = SwModule::GetNextView(pTmpView); + } + +} /*-----------------13.11.96 11.57------------------- --------------------------------------------------*/ @@ -891,25 +927,67 @@ const String& SwModule::GetDocStatWordDelim() const { return pModuleConfig->GetWordDelimiter(); } +/* --------------------------------------------------------------------------- - + ---------------------------------------------------------------------------*/ // Durchreichen der Metric von der ModuleConfig (fuer HTML-Export) sal_uInt16 SwModule::GetMetric( sal_Bool bWeb ) const { - return pModuleConfig->GetMetric( bWeb ); + SwMasterUsrPref* pPref; + if(bWeb) + { + if(!pWebUsrPref) + GetUsrPref(sal_True); + pPref = pWebUsrPref; + } + else + { + if(!pUsrPref) + GetUsrPref(sal_False); + pPref = pUsrPref; + } + return pPref->GetMetric(); } +/* --------------------------------------------------------------------------- + ---------------------------------------------------------------------------*/ // Update-Stati durchreichen sal_uInt16 SwModule::GetLinkUpdMode( sal_Bool ) const { - return pModuleConfig->GetLinkMode(); + if(!pUsrPref) + GetUsrPref(sal_False); + return pUsrPref->GetUpdateLinkMode(); } +/* --------------------------------------------------------------------------- + ---------------------------------------------------------------------------*/ sal_uInt16 SwModule::GetFldUpdateFlags( sal_Bool ) const { - return pModuleConfig->GetFldUpdateFlags(); + if(!pUsrPref) + GetUsrPref(sal_False); + return (sal_uInt16)pUsrPref->GetFldUpdateFlags(); +} +/* -----------------------------28.09.00 14:18-------------------------------- + + ---------------------------------------------------------------------------*/ +void SwModule::ApplyFldUpdateFlags(sal_Int32 nFldFlags) +{ + if(!pUsrPref) + GetUsrPref(sal_False); + pUsrPref->SetFldUpdateFlags(nFldFlags); +} +/* -----------------------------28.09.00 14:18-------------------------------- + + ---------------------------------------------------------------------------*/ +void SwModule::ApplyLinkMode(sal_Int32 nNewLinkMode) +{ + if(!pUsrPref) + GetUsrPref(sal_False); + pUsrPref->SetUpdateLinkMode(nNewLinkMode); } +/* --------------------------------------------------------------------------- + ---------------------------------------------------------------------------*/ void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling, sal_Bool bIsSpellWrongAgain, sal_Bool bIsSpellAllAgain ) { @@ -931,162 +1009,4 @@ void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling, } } -/*------------------------------------------------------------------------- - $Log: not supported by cvs2svn $ - Revision 1.50 2000/09/18 16:05:12 willem.vandorp - OpenOffice header added. - - Revision 1.49 2000/09/08 15:11:56 os - use configuration service - - Revision 1.48 2000/09/07 15:59:20 os - change: SFX_DISPATCHER/SFX_BINDINGS removed - - Revision 1.47 2000/09/07 08:25:24 os - SwPrintOptions uses configuration service - - Revision 1.46 2000/07/18 12:50:07 os - replace ofadbmgr - - Revision 1.45 2000/05/26 07:21:28 os - old SW Basic API Slots removed - - Revision 1.44 2000/05/16 09:15:11 os - project usr removed - - Revision 1.43 2000/05/11 12:05:29 tl - if[n]def ONE_LINGU entfernt - - Revision 1.42 2000/03/30 13:28:04 os - UNO III - - Revision 1.41 2000/03/29 12:46:55 jp - Bug #74570#: ShowDBObj - if no table and no query exist, set default to table - - Revision 1.40 2000/03/21 15:47:50 os - UNOIII - - Revision 1.39 2000/02/11 14:43:07 hr - #70473# changes for unicode ( patched by automated patchtool ) - - Revision 1.38 2000/02/09 07:58:08 os - #72824# check if beamer is available - - Revision 1.37 2000/01/13 11:31:37 tl - #70735# fixed CheckSpellChanges bug - - Revision 1.36 2000/01/11 10:33:54 tl - #70735# CheckSpellChanges moved from SwDoc to here - - Revision 1.35 2000/01/06 12:54:01 hr - #65293#: END_CATCH - - Revision 1.34 2000/01/06 07:32:38 os - #71436# mail merge dialog: execute via status method disposed - - Revision 1.33 1999/06/22 15:37:58 JP - Bug #43028#: disableflag for edit in mailbody - - - Rev 1.32 22 Jun 1999 17:37:58 JP - Bug #43028#: disableflag for edit in mailbody - - Rev 1.31 20 Apr 1999 18:59:24 JP - Task #65061#: neu: ZahlenFormaterkennung abschaltbar - - Rev 1.30 12 Mar 1999 09:55:32 JP - Task #61405#: Optionen setzen - - Rev 1.29 12 Mar 1999 09:45:04 OS - #63044# Datenbank-Fehlermeldung anzeigen - - Rev 1.28 01 Mar 1999 16:20:52 MA - #62490# Altlast entfernt (Drucken und Briefumschlaege/Etiketten und Datenbank) - - Rev 1.27 23 Feb 1999 16:19:38 OS - #62281# UsrPrefs per UNO nur auf aktuelle sdbcx::View anwenden - - Rev 1.26 17 Feb 1999 08:37:24 OS - #58158# Einfuegen TabPage auch in HTML-Docs - - Rev 1.25 27 Jan 1999 10:05:22 OS - #58677# Cursor in Readonly-Bereichen - - Rev 1.24 26 Jan 1999 11:50:10 MIB - #60875#: Beim HTML-Export Einheit aus Extras/Optionen/Text-/HTML-Dokument nehmen - - Rev 1.23 23 Nov 1998 17:36:52 JP - Bug #59754#: TerminateHdl wird nicht mehr fuers Clipboard benoetigt - - Rev 1.22 20 Nov 1998 14:01:32 OM - #59720# Neue Tabellenoptionen beim Einfuegen - - Rev 1.21 05 Oct 1998 17:16:54 OM - #57458# Auch Queries ueber F4 anzeigen - - Rev 1.20 24 Sep 1998 13:33:02 OS - #52654# #56685# XTerminateListener fuer die Anmeldung an der Application - - Rev 1.19 24 Aug 1998 12:20:54 OM - #54552# Serienbriefdialog: Statusupdate immer erzwingen - - Rev 1.18 14 Jul 1998 12:09:06 OS - Scrollbars nur umschalten, wenn sich die ViewOptions wirklich veraendert haben #52708# - - Rev 1.17 25 May 1998 12:41:28 JP - nMergeType wurde private, ueber SetMergeType setzen - - Rev 1.16 15 May 1998 12:50:02 OM - Worttrenner - - Rev 1.15 14 May 1998 16:46:00 OM - Worttrenner konfigurierbar - - Rev 1.14 24 Apr 1998 19:36:54 JP - neu: DocStat WordDelimiter aus der Configuration holen - - Rev 1.13 24 Mar 1998 17:45:28 OM - Formataenderung anzeigen - - Rev 1.12 24 Mar 1998 13:43:56 JP - neu: Redline fuer harte Attributierung - - Rev 1.11 16 Mar 1998 19:09:48 OM - Zugriff auf Ini optimiert - - Rev 1.10 15 Mar 1998 16:57:22 MA - #48342# richtig initialisieren - - Rev 1.9 10 Mar 1998 12:23:42 OM - Get...AuthorAttr - - Rev 1.8 05 Mar 1998 14:44:08 OM - Redline-Attribute in Module-Cfg speichern - - Rev 1.7 03 Mar 1998 17:00:46 OS - GetViewOption - - Rev 1.6 28 Feb 1998 15:12:42 OM - Accept / reject changes - - Rev 1.5 24 Feb 1998 15:32:04 OM - Redline-Darstellungsoptionen setzen - - Rev 1.4 08 Dec 1997 11:46:16 OS - benannte Numerierungen entfernt - - Rev 1.3 24 Nov 1997 14:22:36 MA - includes - - Rev 1.2 18 Nov 1997 14:33:42 OM - Sba-Umstellung 372 - - Rev 1.1 02 Sep 1997 10:21:08 OS - includes - - Rev 1.0 01 Sep 1997 13:09:16 OS - Initial revision. - - --------------------------------------------------------------------------*/ diff --git a/sw/source/ui/config/modcfg.cxx b/sw/source/ui/config/modcfg.cxx index d2c755fb015c..0e5ed44b6c8b 100644 --- a/sw/source/ui/config/modcfg.cxx +++ b/sw/source/ui/config/modcfg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: modcfg.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:33 $ + * last change: $Author: os $ $Date: 2000-09-28 15:23:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -209,7 +209,7 @@ int SwModuleOptions::Load(SvStream& rStream) UINT32 nColor; UINT16 nVal; rStream >> nVal; - nDefTab = nVal; +// nDefTab = nVal; rStream >> nVal; nTblHMove = nVal; @@ -225,11 +225,11 @@ int SwModuleOptions::Load(SvStream& rStream) BYTE bVal; rStream >> bVal; - eUserMetric = (FieldUnit)bVal; +// eUserMetric = (FieldUnit)bVal; if (nVersion >= VERSION_08) { rStream >> bVal; - eWebUserMetric = (FieldUnit)bVal; +// eWebUserMetric = (FieldUnit)bVal; } @@ -317,7 +317,7 @@ int SwModuleOptions::Load(SvStream& rStream) { rStream >> bVal; bInsTblFormatNum = bVal; rStream >> bVal; bInsTblAlignNum = bVal; - rStream >> nVal; nLinkMode = nVal; + rStream >> nVal; //nLinkMode = nVal; if (nVersion == VERSION_12) rStream >> bVal; // Flag gibts nicht mehr @@ -328,10 +328,10 @@ int SwModuleOptions::Load(SvStream& rStream) } if(nVersion >= VERSION_14) { - rStream>> nVal; nFldUpdateFlags = nVal; + rStream>> nVal; //nFldUpdateFlags = nVal; } - else - nFldUpdateFlags = AUTOUPD_OFF; +// else +// nFldUpdateFlags = AUTOUPD_OFF; if(nVersion >= VERSION_15) { rStream >> bVal; bHTMLInsWithCaption = bVal; @@ -387,13 +387,13 @@ BOOL SwModuleOptions::Store(SvStream& rStream) { rtl_TextEncoding eEncoding = gsl_getSystemTextEncoding(); rStream << (UINT16) MODCFG_VERSION; - rStream << (UINT16) nDefTab; + rStream << (UINT16) 0;//nDefTab; rStream << (UINT16) nTblHMove; rStream << (UINT16) nTblVMove; rStream << (UINT16) nTblHInsert; rStream << (UINT16) nTblVInsert; - rStream << (BYTE) eUserMetric; - rStream << (BYTE) eWebUserMetric; + rStream << (BYTE) 0;//eUserMetric; + rStream << (BYTE) 0;//eWebUserMetric; rStream << (BYTE) eTblChgMode; rStream << (BYTE) bGrfToGalleryAsLnk; rStream << (BYTE) nMailingFormats; @@ -420,9 +420,9 @@ BOOL SwModuleOptions::Store(SvStream& rStream) rStream << *aCapOptions[i]; rStream << (BYTE) bInsTblFormatNum; rStream << (BYTE) bInsTblAlignNum; - rStream << (UINT16) nLinkMode; + rStream << (UINT16) 0;//nLinkMode; rStream << (UINT16) nInsTblFlags; - rStream << (UINT16) nFldUpdateFlags; + rStream << (UINT16) 0;//nFldUpdateFlags; rStream << (BYTE) bHTMLInsWithCaption; rStream << (BYTE) bHTMLInsTblFormatNum; @@ -446,7 +446,7 @@ BOOL SwModuleOptions::Store(SvStream& rStream) void SwModuleOptions::UseDefault() { - MeasurementSystem eSys = Application::GetAppInternational().GetMeasurementSystem(); +/* MeasurementSystem eSys = Application::GetAppInternational().GetMeasurementSystem(); if(MEASURE_METRIC != eSys) { eUserMetric = eWebUserMetric = FUNIT_INCH; @@ -462,7 +462,7 @@ void SwModuleOptions::UseDefault() nTblHMove = nTblVMove = MM50; // 0,5 cm nTblHInsert = MM50; // 0,5 cm nTblVInsert = 1415; // 2,5 cm - } + }*/ eTblChgMode = TBLVAR_CHGABS; @@ -494,8 +494,8 @@ void SwModuleOptions::UseDefault() bHTMLInsTblChangeNumFormat = bInsTblChangeNumFormat = TRUE; bHTMLInsTblAlignNum = bInsTblAlignNum = TRUE; - nLinkMode = MANUAL; - nFldUpdateFlags = AUTOUPD_FIELD_ONLY; +// nLinkMode = MANUAL; +// nFldUpdateFlags = AUTOUPD_FIELD_ONLY; bShowAutoTextPreview = TRUE; bShowIndexPreview = TRUE; @@ -530,6 +530,9 @@ String SwModuleOptions::GetName() const /*-------------------------------------------------------------------- $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:33 hr + initial import + Revision 1.34 2000/09/18 16:05:15 willem.vandorp OpenOffice header added. diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 5b5ef335648f..7e508a84eaa8 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -2,9 +2,9 @@ * * $RCSfile: optload.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:33 $ + * last change: $Author: os $ $Date: 2000-09-28 15:23:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,8 +78,9 @@ #endif #include "swmodule.hxx" -#include "modcfg.hxx" +#include "usrpref.hxx" #include "wrtsh.hxx" +#include "linkenum.hxx" #include "globals.hrc" #include "cmdid.h" @@ -151,7 +152,8 @@ SfxTabPage* __EXPORT SwLoadOptPage::Create( Window* pParent, BOOL __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) { BOOL bRet = FALSE; - SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); + SwModule* pMod = SW_MOD(); +// SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); BOOL bFldDocOnly = aFldDocOnlyCB.IsChecked(); BOOL bLinkDocOnly = aLinkDocOnlyCB.IsChecked(); @@ -170,7 +172,7 @@ BOOL __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) aAutoUpdateCharts.IsChecked() != aAutoUpdateCharts.GetSavedValue()) { if (!bFldDocOnly || !pWrtShell) - pModOpt->SetFldUpdateFlags(nFldFlags); + pMod->ApplyFldUpdateFlags(nFldFlags); if(pWrtShell) { USHORT nSet = bFldDocOnly ? nFldFlags : AUTOUPD_GLOBALSETTING; @@ -182,7 +184,7 @@ BOOL __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) if (nNewLinkMode != nOldLinkMode) { if (!bLinkDocOnly || !pWrtShell) - pModOpt->SetLinkMode(nNewLinkMode); + pMod->ApplyLinkMode(nNewLinkMode); if (pWrtShell) { @@ -211,7 +213,7 @@ BOOL __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) void __EXPORT SwLoadOptPage::Reset( const SfxItemSet& rSet) { - const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); + const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref(FALSE); const SfxPoolItem* pItem; if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_WRTSHELL, FALSE, &pItem)) @@ -233,12 +235,12 @@ void __EXPORT SwLoadOptPage::Reset( const SfxItemSet& rSet) } if(nOldLinkMode == GLOBALSETTING) { - nOldLinkMode = pModOpt->GetLinkMode(); + nOldLinkMode = pUsrPref->GetUpdateLinkMode(); bLinkDocOnly = FALSE; } if(nFldFlags == AUTOUPD_GLOBALSETTING) { - nFldFlags = pModOpt->GetFldUpdateFlags(); + nFldFlags = pUsrPref->GetFldUpdateFlags(); bFldDocOnly = FALSE; } @@ -268,6 +270,9 @@ void __EXPORT SwLoadOptPage::Reset( const SfxItemSet& rSet) /*-------------------------------------------------------------------- $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:33 hr + initial import + Revision 1.12 2000/09/18 16:05:17 willem.vandorp OpenOffice header added. diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx index 1180dc1ec072..224862d040aa 100644 --- a/sw/source/ui/config/usrpref.cxx +++ b/sw/source/ui/config/usrpref.cxx @@ -2,9 +2,9 @@ * * $RCSfile: usrpref.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:33 $ + * last change: $Author: os $ $Date: 2000-09-28 15:23:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,8 +75,6 @@ #include "uitool.hxx" #include "usrpref.hxx" #include "crstate.hxx" -#include "cfgid.h" -#include "cfgstr.hrc" #ifndef _OFA_OSPLCFG_HXX #include <offmgr/osplcfg.hxx> #endif @@ -90,47 +88,23 @@ #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> #endif +#ifndef _COM_SUN_STAR_UNO_ANY_HXX_ +#include <com/sun/star/uno/Any.hxx> +#endif +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif +using namespace utl; +using namespace rtl; using namespace ::com::sun::star; -using namespace ::rtl; +using namespace com::sun::star::uno; #define C2U(cChar) OUString::createFromAscii(cChar) #define C2S(cChar) String::CreateFromAscii(cChar) -#define VERSION_30B ((sal_uInt16)250) //Beta1 ?? -#define VERSION_30B2 ((sal_uInt16)251) //Beta2 -#define VERSION_30B3 ((sal_uInt16)252) //Beta2.9 -#define VERSION_30B4 ((sal_uInt16)253) //Beta3.1 -#define VERSION_30B5 ((sal_uInt16)254) //Beta4 -#define VERSION_30B6 ((sal_uInt16)256) //Beta6 -#define VERSION_301B6 ((sal_uInt16)257) //Beta6+OnlineSpelling -#define VERSION_301_03 ((sal_uInt16)258) //Flag fuer BrowseMode -#define VERSION_301_04 ((sal_uInt16)259) //Flag fuer Massstab beibehalten (Crop) -#define VERSION_391_05 ((sal_uInt16)260) //Endlich das product/non-product chaos aufgeloest. -#define VERSION_302_01 ((sal_uInt16)313) //Zusammenfassung der Optionen ab SV 313 -#define VERSION_302_02 ((sal_uInt16)325) //nTblDest neu -#define VERSION_326e ((sal_uInt16)326) //PrintPageBack neu -#define VERSION_327c ((sal_uInt16)327) //ExecHyperlinks neu -#define VERSION_328 ((sal_uInt16)328) //HtmlMode -#define VERSION_332 ((sal_uInt16)332) //DefaultBackground -#define VERSION_333 ((sal_uInt16)333) //Symbolfont-Position -#define VERSION_346 ((sal_uInt16)346) //nCore2Options neu -#define VERSION_349 ((sal_uInt16)349) //TabDist und UndoCount raus -#define VERSION_4SP2a ((sal_uInt16)400) //HiddenPara, Fixpack II -#define VERSION_371 ((sal_uInt16)471) //ShadowCrsr -#define VERSION_388 ((sal_uInt16)500) //BackgroundBrush -> Background Color -#define VERSION_511 ((sal_uInt16)511) //Bereichsbegrenzung, Cursor in gesch. Zonen -#define VERSION_512 ((sal_uInt16)512) //index background flag and color - - -// mit der naechsten Version koennen die Dummies fuer die TabDist raus - -#define USRPEF_VERSION VERSION_512 - - sal_Bool bNotLoadLayout = sal_False; // fuer MD - void SwMasterUsrPref::SetUsrPref(const SwViewOption &rCopy) { *((SwViewOption*)this) = rCopy; @@ -140,679 +114,327 @@ void SwMasterUsrPref::SetUsrPref(const SwViewOption &rCopy) #endif } -/*------------------------------------------------------------------------ - Beschreibung: Schreiben / Lesen Konfiguration. - Die einzelnen Bits des Bitfeldes muessen als - char geschrieben werden, da die Bits eines Bytes - auf den verschiedenen Plattformen unterschiedlich - abgelegt werden. -------------------------------------------------------------------------*/ - - -sal_Bool SwMasterUsrPref::Store(SvStream& rStream) +/* +void SwMasterUsrPref::UseDefault() { - rStream << USRPEF_VERSION; - -#ifdef PRODUCT - rStream << sal_Int8(1); -#else - rStream << sal_Int8(0); -#endif - - rStream << nCoreOptions; - rStream << nCore2Options; - rStream << nUIOptions; - - rStream << sal_uInt32(GetSnapSize().Width()); - rStream << sal_uInt32(GetSnapSize().Height()); - rStream << sal_uInt16(GetDivisionX()); - rStream << sal_uInt16(GetDivisionY()); - - rStream << sal_uInt16(GetZoom()); - rStream << sal_uInt16(eZoom); - rStream << sal_Int8(nTblDest); - - rStream << sal_uInt16(::GetDfltMetric(sal_False)); - - rStream.WriteByteString(sSymbolFont, gsl_getSystemTextEncoding()); + nUIOptions = VIEWOPT_2_EXECHYPERLINKS; + nCore2Options = VIEWOPT_CORE2_CRSR_IN_PROT| VIEWOPT_CORE2_INDEX_BACKGROUND| - rStream << sal_Int8(GetPagePrevRow()); - rStream << sal_Int8(GetPagePrevCol()); + eZoom = 0; + nTblDest = TBL_DEST_CELL; - rStream << sal_uInt32(GetRetoucheColor().GetColor()); + sSymbolFont = aEmptyStr; - rStream << (sal_Int8)nShdwCrsrFillMode; - rStream << (sal_uInt32)aShdwCrsrCol.GetColor(); + aShdwCrsrCol.SetColor( COL_BLUE ); + nShdwCrsrFillMode = FILL_TAB; - rStream << (sal_uInt32)aIdxBackgrndCol.GetColor(); + aIdxBackgrndCol.SetColor( RGB_COLORDATA( 0xF0, 0xF0, 0xF0 ) ); -#ifndef PRODUCT - sal_Int8 nFlags3 = 0; - if ( bTest1 ) nFlags3 |= 0x01; - if ( bTest2 ) nFlags3 |= 0x02; - if ( bTest3 ) nFlags3 |= 0x04; - if ( bTest4 ) nFlags3 |= 0x08; - if ( bTest5 ) nFlags3 |= 0x10; - if ( bTest6 ) nFlags3 |= 0x20; - if ( bTest7 ) nFlags3 |= 0x40; - if ( bTest8 ) nFlags3 |= 0x80; - rStream << nFlags3; -#endif + uno::Reference< beans::XPropertySet > xProp( ::GetLinguPropertySet() ); - return SfxConfigItem::ERR_OK; + sal_Bool bVal; + bVal = xProp.is() ? + *(sal_Bool*)xProp->getPropertyValue( C2U(UPN_IS_SPELL_AUTO) ).getValue() : sal_False; + SetOnlineSpell( bVal ); + bVal = xProp.is() ? + *(sal_Bool*)xProp->getPropertyValue( C2U(UPN_IS_SPELL_HIDE) ).getValue() : sal_False; + SetHideSpell( bVal ); + SfxConfigItem::UseDefault(); } +*/ - - -int SwMasterUsrPref::Load(SvStream& rStream) +SwMasterUsrPref::SwMasterUsrPref(BOOL bWeb) : + aContentConfig(bWeb, *this), + aLayoutConfig(bWeb, *this) { - SetDefault( sal_False ); - - sal_uInt16 nVersion; - rStream >> nVersion; - - sal_Int8 nProductFlag; - if ( nVersion >= VERSION_391_05 ) - rStream >> nProductFlag; + aContentConfig.Load(); + aLayoutConfig.Load(); +} +/*-- 28.09.00 09:55:32--------------------------------------------------- - if( nVersion >= VERSION_30B6 && nVersion < VERSION_302_01 ) + -----------------------------------------------------------------------*/ +Sequence<OUString> SwContentViewConfig::GetPropertyNames() +{ + static const char* aPropNames[] = { - nCore2Options = VIEWOPT_CORE2_BLACKFONT; - sal_uInt16 nFlags; - rStream >> nFlags; - nUIOptions = 0; - nUIOptions |= (nFlags & 0x0001) ? VIEWOPT_2_TOOLBOX : 0 ; - nUIOptions |= (nFlags & 0x0002) ? VIEWOPT_2_TOOLBOXTEXT : 0 ; - nUIOptions |= (nFlags & 0x0004) ? VIEWOPT_2_TOOLBOXBITMAP : 0 ; - nUIOptions |= (nFlags & 0x0008) ? VIEWOPT_2_TOOLBOXBOTH : 0 ; - nUIOptions |= (nFlags & 0x0010) ? VIEWOPT_2_TOOLBOXLEFT : 0 ; - nUIOptions |= (nFlags & 0x0020) ? VIEWOPT_2_TOOLBOXRIGHT : 0 ; - nUIOptions |= (nFlags & 0x0040) ? VIEWOPT_2_TOOLBOXTOP : 0 ; - nUIOptions |= (nFlags & 0x0080) ? VIEWOPT_2_TOOLBOXBOTTOM : 0 ; - nUIOptions |= (nFlags & 0x0100) ? VIEWOPT_2_UNUSED1 : 0 ; - nUIOptions |= (nFlags & 0x0200) ? VIEWOPT_2_RIBBONBAR : 0 ; - nUIOptions |= (nFlags & 0x0400) ? VIEWOPT_2_TABWIN : 0 ; - nUIOptions |= (nFlags & 0x0800) ? VIEWOPT_2_VSCROLLBAR : 0 ; - nUIOptions |= (nFlags & 0x1000) ? VIEWOPT_2_HSCROLLBAR : 0 ; - nUIOptions |= (nFlags & 0x2000) ? VIEWOPT_2_STATUSLINE : 0 ; - nUIOptions |= (nFlags & 0x4000) ? VIEWOPT_2_VLIN : 0 ; - nUIOptions |= (nFlags & 0x8000) ? VIEWOPT_2_SVLOOK : 0 ; - - - sal_uInt32 nFlags2; - rStream >> nFlags2; - nCoreOptions = VIEWOPT_1_IDLE; - nCoreOptions |= (nFlags2 & 0x00000001) ? VIEWOPT_1_TAB : 0; - nCoreOptions |= (nFlags2 & 0x00000002) ? VIEWOPT_1_BLANK : 0; - nCoreOptions |= (nFlags2 & 0x00000004) ? VIEWOPT_1_HARDBLANK : 0; - nCoreOptions |= (nFlags2 & 0x00000008) ? VIEWOPT_1_PARAGRAPH : 0; - nCoreOptions |= (nFlags2 & 0x00000010) ? VIEWOPT_1_LINEBREAK : 0; - nCoreOptions |= (nFlags2 & 0x00000020) ? VIEWOPT_1_PAGEBREAK : 0; - nCoreOptions |= (nFlags2 & 0x00000040) ? VIEWOPT_1_COLUMNBREAK: 0; - nCoreOptions |= (nFlags2 & 0x00000080) ? VIEWOPT_1_SOFTHYPH : 0; - nCoreOptions |= (nFlags2 & 0x00000100) ? VIEWOPT_1_TOX : 0; - nCoreOptions |= (nFlags2 & 0x00000200) ? VIEWOPT_1_REF : 0; - nCoreOptions |= (nFlags2 & 0x00000400) ? VIEWOPT_1_FLDNAME : 0; - nCoreOptions |= (nFlags2 & 0x00000800) ? VIEWOPT_1_FIELD : 0; - nCoreOptions |= (nFlags2 & 0x00001000) ? VIEWOPT_1_FOOTNOTE : 0; - nCoreOptions |= (nFlags2 & 0x00002000) ? VIEWOPT_1_POSTITS : 0; - nCoreOptions |= (nFlags2 & 0x00004000) ? VIEWOPT_1_HIDDEN : 0; - nCoreOptions |= (nFlags2 & 0x00008000) ? VIEWOPT_1_SUBSLINES : 0; - nCoreOptions |= (nFlags2 & 0x00010000) ? VIEWOPT_1_GRAPHIC : 0; - nCoreOptions |= (nFlags2 & 0x00020000) ? VIEWOPT_1_TABLE : 0; - nCoreOptions |= (nFlags2 & 0x00040000) ? VIEWOPT_1_SUBSTABLE : 0; - nCoreOptions |= (nFlags2 & 0x00080000) ? VIEWOPT_1_CROSSHAIR : 0; - nCoreOptions |= (nFlags2 & 0x00100000) ? VIEWOPT_1_SNAP : 0; - nCoreOptions |= (nFlags2 & 0x00200000) ? VIEWOPT_1_SYNCHRONIZE: 0; - nCoreOptions |= (nFlags2 & 0x00400000) ? VIEWOPT_1_GRIDVISIBLE: 0; - nCoreOptions |= (nFlags2 & 0x00800000) ? VIEWOPT_1_DRAW : 0; - - sal_uInt32 lWidth, lHeight; - rStream >> lWidth; - rStream >> lHeight; - Size aSz( lWidth, lHeight ); - SetSnapSize( aSz ); - - sal_uInt16 sVal; - rStream >> sVal; - SetDivisionX( sVal ); - rStream >> sVal; - SetDivisionY( sVal ); - - sal_uInt16 nZoom; - rStream >> nZoom; - SetZoom( nZoom ); - rStream >> nZoom; - eZoom = int(nZoom); - nTblDest = TBL_DEST_CELL; - - sal_uInt16 nMet; - //Default-Tabulator und Metric - // werden noch gelesen/geschrieben, damit die Version bleiben kann - rStream >> nMet; - rStream >> nMet; - - sal_Int8 nPrev; - rStream >> nPrev; - SetPagePrevRow(nPrev); - rStream >> nPrev; - SetPagePrevCol(nPrev); - - sal_uInt16 nUndo; - rStream >> nUndo; - - if( nVersion > VERSION_30B6 ) - { - rStream >> nPrev; - SetKeepRatio( nPrev ); - } - else - SetKeepRatio( sal_False ); - if( nVersion > VERSION_301_03 ) - { - rStream >> nPrev; - SetGrfKeepZoom( nPrev ) ; - } - else - SetGrfKeepZoom( sal_False ); - -#ifndef PRODUCT - if ( nVersion < VERSION_391_05 || nProductFlag == sal_Int8(0) ) + "Display/GraphicObject", // 0 + "Display/Table", // 1 + "Display/DrawingControl", // 2 + "Display/FieldCode", // 3 + "Display/Note", // 4 + "Highlighting/Field", // 5 + "NonprintingCharacter/ParagraphEnd", // 6 + "NonprintingCharacter/OptionalHyphen", // 7 + "NonprintingCharacter/Space", // 8 + "NonprintingCharacter/ProtectedSpace", // 9 + "NonprintingCharacter/Break", // 10 + "Highlighting/IndexEntry", // 11 //not in Writer/Web + "Highlighting/Index", // 12 + "Highlighting/Footnote", // 13 + "NonprintingCharacter/Tab", // 14 + "NonprintingCharacter/HiddenText", // 15 + "NonprintingCharacter/HiddenParagraph", // 16 + "Update/Link", // 17 + "Update/Field", // 18 + "Update/Chart" // 19 + }; + const int nCount = bWeb ? 11 : 20; + Sequence<OUString> aNames(nCount); + OUString* pNames = aNames.getArray(); + for(int i = 0; i < nCount; i++) { - sal_Int8 nFlags3; - rStream >> nFlags3; - bTest1 = sal_Int8( (nFlags3 & 0x01) != 0 ); - if(bNotLoadLayout && !bTest1) - DBG_ERROR("Layout wird doch geladen - nochmal versuchen!") - bNotLoadLayout = bTest1; - - bTest2 = sal_Int8( (nFlags3 & 0x02) != 0 ); - bTest3 = sal_Int8( (nFlags3 & 0x04) != 0 ); - bTest4 = sal_Int8( (nFlags3 & 0x08) != 0 ); - bTest5 = sal_Int8( (nFlags3 & 0x10) != 0 ); - bTest6 = sal_Int8( (nFlags3 & 0x20) != 0 ); - bTest7 = sal_Int8( (nFlags3 & 0x40) != 0 ); - bTest8 = sal_Int8( (nFlags3 & 0x80) != 0 ); - } - else - bTest1 = bTest2 = bTest3 = bTest4 = bTest5 = bTest6 = - bTest7 = bTest8 = bNotLoadLayout = sal_False; -#endif + pNames[i] = OUString::createFromAscii(aPropNames[i]); } - else if( nVersion >= VERSION_302_01) - { - rStream >> nCoreOptions; - nCoreOptions |= VIEWOPT_1_IDLE; - if( nVersion < VERSION_326e ) - nCoreOptions |= VIEWOPT_1_PAGEBACK; - if(nVersion >= VERSION_346) - { - rStream >> nCore2Options; - if ( nVersion < VERSION_4SP2a ) - nCore2Options |= VIEWOPT_CORE2_HIDDENPARA; - } - else - nCore2Options = VIEWOPT_CORE2_BLACKFONT | VIEWOPT_CORE2_HIDDENPARA; - - if(nVersion < VERSION_511) - { - nCore2Options &= ~VIEWOPT_CORE2_SECTION_BOUNDS; - nCore2Options |= VIEWOPT_CORE2_CRSR_IN_PROT; - } - if(nVersion < VERSION_512) - { - nCore2Options |= VIEWOPT_CORE2_INDEX_BACKGROUND; - } + return aNames; +} +/*-- 28.09.00 09:55:33--------------------------------------------------- - rStream >> nUIOptions; - if( nVersion < VERSION_327c ) - nUIOptions |= VIEWOPT_2_EXECHYPERLINKS; - sal_uInt32 lWidth, lHeight; - rStream >> lWidth; - rStream >> lHeight; - Size aSz( lWidth, lHeight ); - SetSnapSize( aSz ); - - sal_uInt16 sVal; - rStream >> sVal; - SetDivisionX( sVal ); - rStream >> sVal; - SetDivisionY( sVal ); - - sal_uInt16 nZoom; - rStream >> nZoom; - SetZoom( nZoom ); - rStream >> nZoom; - eZoom = int(nZoom); - if(nVersion >= VERSION_302_02) - { - sal_Int8 nDest; - rStream >> nDest; - nTblDest = Min((sal_Int8)TBL_DEST_TBL, nDest); - } - else - { - nTblDest = TBL_DEST_CELL; - } + -----------------------------------------------------------------------*/ +SwContentViewConfig::SwContentViewConfig(BOOL bIsWeb, SwMasterUsrPref& rPar) : + ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Content") : C2U("Office.Writer/Content")), + rParent(rPar), + bWeb(bIsWeb) +{ +} +/*-- 28.09.00 09:55:33--------------------------------------------------- + -----------------------------------------------------------------------*/ +SwContentViewConfig::~SwContentViewConfig() +{ +} +/*-- 28.09.00 09:55:33--------------------------------------------------- - sal_uInt16 nMet; - //Default-Tabulator und Metric - // werden noch gelesen/geschrieben, damit die Version bleiben kann - rStream >> nMet; - if(nVersion < VERSION_349) - rStream >> nMet; + -----------------------------------------------------------------------*/ +void SwContentViewConfig::Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames) +{ + Load(); +} +/*-- 28.09.00 09:55:33--------------------------------------------------- - if(nVersion >= VERSION_333) - rStream.ReadByteString(sSymbolFont, gsl_getSystemTextEncoding()); + -----------------------------------------------------------------------*/ +void SwContentViewConfig::Commit() +{ + Sequence<OUString> aNames = GetPropertyNames(); - sal_Int8 nPrev; - rStream >> nPrev; - SetPagePrevRow(nPrev); - rStream >> nPrev; - SetPagePrevCol(nPrev); + OUString* pNames = aNames.getArray(); + Sequence<Any> aValues(aNames.getLength()); + Any* pValues = aValues.getArray(); - // Undo einlesen - if(nVersion < VERSION_349) + const Type& rType = ::getBooleanCppuType(); + for(int nProp = 0; nProp < aNames.getLength(); nProp++) + { + sal_Bool bVal = FALSE; + switch(nProp) { - sal_uInt16 nUndo; - rStream >> nUndo; + case 0: bVal = rParent.IsGraphic(); break;// "Display/GraphicObject", + case 1: bVal = rParent.IsTable(); break;// "Display/Table", + case 2: bVal = rParent.IsDraw(); break;// "Display/DrawingControl", + case 3: bVal = rParent.IsFldName(); break;// "Display/FieldCode", + case 4: bVal = rParent.IsPostIts(); break;// "Display/Note", + case 5: bVal = rParent.IsField(); break;// "Highlighting/Field", + case 6: bVal = rParent.IsPageBreak(); break;// "NonprintingCharacter/ParagraphEnd", + case 7: bVal = rParent.IsSoftHyph(); break;// "NonprintingCharacter/OptionalHyphen", + case 8: bVal = rParent.IsBlank(); break;// "NonprintingCharacter/Space", + case 9: bVal = rParent.IsHardBlank(); break;// "NonprintingCharacter/ProtectedSpace", + case 10: bVal = rParent.IsLineBreak();break;// "NonprintingCharacter/Break", + case 11: bVal = rParent.IsTox(); break;// "Highlighting/IndexEntry", + case 12: bVal = rParent.IsIndexBackground(); break;// "Highlighting/Index", + case 13: bVal = rParent.IsFootNote(); break;// "Highlighting/Footnote", + case 14: bVal = rParent.IsTab(); break;// "NonprintingCharacter/Tab", + case 15: bVal = rParent.IsHidden(); break;// "NonprintingCharacter/HiddenText", + case 16: bVal = rParent.IsShowHiddenPara(); break;// "NonprintingCharacter/HiddenParagraph", + case 17: pValues[nProp] <<= rParent.GetUpdateLinkMode(); break;// "Update/Link", + case 18: bVal = rParent.IsUpdateFields(); break;// "Update/Field", + case 19: bVal = rParent.IsUpdateCharts(); break;// "Update/Chart" } + if(nProp != 17) + pValues[nProp].setValue(&bVal, ::getBooleanCppuType()); + } + PutProperties(aNames, aValues); +} +/*-- 28.09.00 09:55:34--------------------------------------------------- - if(nVersion >= VERSION_332) + -----------------------------------------------------------------------*/ +void SwContentViewConfig::Load() +{ + Sequence<OUString> aNames = GetPropertyNames(); + Sequence<Any> aValues = GetProperties(aNames); + EnableNotification(aNames); + const Any* pValues = aValues.getConstArray(); + DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed") + if(aValues.getLength() == aNames.getLength()) + { + for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - sal_uInt32 nColor; - if ( nVersion < VERSION_388 ) + DBG_ASSERT(pValues[nProp].hasValue(), "property value missing") + if(pValues[nProp].hasValue()) { - sal_Int8 nStyle; - if(GetType() == CFG_USERPREF_ITEM) + sal_Bool bSet = nProp != 17 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False; + switch(nProp) { - // fuer Textdokumente wird keine Farbe gesetzt! - rStream >> nColor; - rStream >> nColor; - rStream >> nStyle; - rStream >> nStyle; - } - else - { - rStream >> nColor; - aRetoucheColor.SetColor( nColor ); - rStream >> nColor; - rStream >> nStyle; - if ( nStyle == 0 /*BRUSH_NULL*/ ) - aRetoucheColor.SetColor( COL_TRANSPARENT ); - rStream >> nStyle; + case 0: rParent.SetGraphic(bSet); break;// "Display/GraphicObject", + case 1: rParent.SetTable(bSet); break;// "Display/Table", + case 2: rParent.SetDraw(bSet); break;// "Display/DrawingControl", + case 3: rParent.SetFldName(bSet); break;// "Display/FieldCode", + case 4: rParent.SetPostIts(bSet); break;// "Display/Note", + case 5: rParent.SetField(bSet); break;// "Highlighting/Field", + case 6: rParent.SetPageBreak(bSet); break;// "NonprintingCharacter/ParagraphEnd", + case 7: rParent.SetSoftHyph(bSet); break;// "NonprintingCharacter/OptionalHyphen", + case 8: rParent.SetBlank(bSet); break;// "NonprintingCharacter/Space", + case 9: rParent.SetHardBlank(bSet); break;// "NonprintingCharacter/ProtectedSpace", + case 10: rParent.SetLineBreak(bSet);break;// "NonprintingCharacter/Break", + case 11: rParent.SetTox(bSet); break;// "Highlighting/IndexEntry", + case 12: rParent.SetIndexBackground(bSet); break;// "Highlighting/Index", + case 13: rParent.SetFootNote(bSet); break;// "Highlighting/Footnote", + case 14: rParent.SetTab(bSet); break;// "NonprintingCharacter/Tab", + case 15: rParent.SetHidden(bSet); break;// "NonprintingCharacter/HiddenText", + case 16: rParent.SetShowHiddenPara(bSet); break;// "NonprintingCharacter/HiddenParagraph", + case 17: + { + sal_Int32 nSet; pValues[nProp] >>= nSet; + rParent.SetUpdateLinkMode(nSet); + } + break;// "Update/Link", + case 18: rParent.SetUpdateFields(bSet); break;// "Update/Field", + case 19: rParent.SetUpdateCharts(bSet); break;// "Update/Chart" } } - else - { - if ( GetType() == CFG_USERPREF_ITEM ) - rStream >> nColor; - else - { - rStream >> nColor; - aRetoucheColor.SetColor( nColor ); - } - } - } - if(nVersion >= VERSION_371) - { - sal_Int8 nMode; - sal_uInt32 nColor; - rStream >> nMode; - rStream >> nColor; - - aShdwCrsrCol.SetColor( nColor ); - nShdwCrsrFillMode = nMode; - } - if(nVersion >= VERSION_512) - { - sal_uInt32 nColor; - rStream >> nColor; - aIdxBackgrndCol.SetColor(nColor); } + } +} +/*-- 28.09.00 09:55:34--------------------------------------------------- -#ifndef PRODUCT - if ( nVersion < VERSION_391_05 || nProductFlag == sal_Int8(0) ) + -----------------------------------------------------------------------*/ +Sequence<OUString> SwLayoutViewConfig::GetPropertyNames() +{ + static const char* aPropNames[] = { - sal_Int8 nFlags3; - rStream >> nFlags3; - bTest1 = sal_Int8( (nFlags3 & 0x01) != 0 ); - if(bNotLoadLayout && !bTest1) - DBG_ERROR("Layout wird doch geladen - nochmal versuchen!") - bNotLoadLayout = bTest1; - bTest2 = sal_Int8( (nFlags3 & 0x02) != 0 ); - bTest3 = sal_Int8( (nFlags3 & 0x04) != 0 ); - bTest4 = sal_Int8( (nFlags3 & 0x08) != 0 ); - bTest5 = sal_Int8( (nFlags3 & 0x10) != 0 ); - bTest6 = sal_Int8( (nFlags3 & 0x20) != 0 ); - bTest7 = sal_Int8( (nFlags3 & 0x40) != 0 ); - bTest8 = sal_Int8( (nFlags3 & 0x80) != 0 ); - } - else - bTest1 = bTest2 = bTest3 = bTest4 = bTest5 = bTest6 = - bTest7 = bTest8 = bNotLoadLayout = sal_False; -#endif + "Line/TextBoundary", // 0 + "Line/TableBoundary", // 1 + "Line/SectionBoundary", // 2 + "Line/Guide", // 3 + "Line/SimpleControlPoint", // 4 + "Line/LargeControlPoint", // 5 + "Window/HorizontalScroll", // 6 + "Window/VerticalScroll", // 7 + "Window/HorizontalRuler", // 8 + "Window/VerticalRuler", // 9 + "Window/SmoothScroll", //10 + "Other/MeasureUnit", //11 + "Other/TabStop", //12 + }; + const int nCount = bWeb ? 12 : 13; + Sequence<OUString> aNames(nCount); + OUString* pNames = aNames.getArray(); + for(int i = 0; i < nCount; i++) + { + pNames[i] = OUString::createFromAscii(aPropNames[i]); } - else - return SfxConfigItem::WARNING_VERSION; - - uno::Reference< beans::XPropertySet > xProp( ::GetLinguPropertySet() ); - - sal_Bool bVal; - bVal = xProp.is() ? - *(sal_Bool*)xProp->getPropertyValue( C2U(UPN_IS_SPELL_AUTO) ).getValue() : sal_False; - SetOnlineSpell( bVal ); - bVal = xProp.is() ? - *(sal_Bool*)xProp->getPropertyValue( C2U(UPN_IS_SPELL_HIDE) ).getValue() : sal_False; - SetHideSpell( bVal ); - return SfxConfigItem::ERR_OK; + return aNames; } +/*-- 28.09.00 09:55:34--------------------------------------------------- - -void SwMasterUsrPref::UseDefault() + -----------------------------------------------------------------------*/ +SwLayoutViewConfig::SwLayoutViewConfig(BOOL bIsWeb, SwMasterUsrPref& rPar) : + ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Layout") : C2U("Office.Writer/Layout")), + rParent(rPar), + bWeb(bIsWeb) { - nUIOptions = VIEWOPT_2_TOOLBOXBITMAP | VIEWOPT_2_TOOLBOXTOP | - VIEWOPT_2_TOOLBOX | VIEWOPT_2_RIBBONBAR | - VIEWOPT_2_TABWIN | VIEWOPT_2_STATUSLINE | - VIEWOPT_2_VSCROLLBAR | VIEWOPT_2_HSCROLLBAR | - VIEWOPT_2_SVLOOK| VIEWOPT_2_EXECHYPERLINKS; - nCore2Options = VIEWOPT_CORE2_BLACKFONT | VIEWOPT_CORE2_HIDDENPARA| - VIEWOPT_CORE2_CRSR_IN_PROT| VIEWOPT_CORE2_INDEX_BACKGROUND| - VIEWOPT_CORE2_SECTION_BOUNDS; - - eZoom = 0; - nTblDest = TBL_DEST_CELL; - - sSymbolFont = aEmptyStr; - - aShdwCrsrCol.SetColor( COL_BLUE ); - nShdwCrsrFillMode = FILL_TAB; - - aIdxBackgrndCol.SetColor( RGB_COLORDATA( 0xF0, 0xF0, 0xF0 ) ); - - uno::Reference< beans::XPropertySet > xProp( ::GetLinguPropertySet() ); - - sal_Bool bVal; - bVal = xProp.is() ? - *(sal_Bool*)xProp->getPropertyValue( C2U(UPN_IS_SPELL_AUTO) ).getValue() : sal_False; - SetOnlineSpell( bVal ); - bVal = xProp.is() ? - *(sal_Bool*)xProp->getPropertyValue( C2U(UPN_IS_SPELL_HIDE) ).getValue() : sal_False; - SetHideSpell( bVal ); - SfxConfigItem::UseDefault(); } +/*-- 28.09.00 09:55:35--------------------------------------------------- - -SwMasterUsrPref::SwMasterUsrPref(sal_uInt16 nType) : - SfxConfigItem( nType ) -{} - - -String SwMasterUsrPref::GetName() const + -----------------------------------------------------------------------*/ +SwLayoutViewConfig::~SwLayoutViewConfig() { - String sName(SW_RES( STR_CFG_USRPREF )); - if(GetType() != CFG_USERPREF_ITEM) - sName.SearchAndReplace(C2S("StarOffice Writer"), C2S("StarOffice Writer/Web")); - return sName; } -/*------------------------------------------------------------------------ - - $Log: not supported by cvs2svn $ - Revision 1.128 2000/09/18 16:05:18 willem.vandorp - OpenOffice header added. - - Revision 1.127 2000/04/11 08:02:24 os - UNICODE - - Revision 1.126 2000/03/23 08:17:22 os - UNO III - - Revision 1.125 2000/03/03 15:16:59 os - StarView remainders removed - - Revision 1.124 2000/02/24 17:26:00 hr - 43447#: gcc - - Revision 1.123 2000/01/19 18:24:06 jp - Bug #72118#: change default of view sectionboundaries - - Revision 1.122 1999/12/10 13:07:24 tl - #70383# SvxGetLinguPropertySet => ::GetLinguPropertySet - - Revision 1.121 1999/11/24 18:26:26 tl - check for Service availability - - Revision 1.120 1999/11/19 16:40:22 os - modules renamed - - Revision 1.119 1999/10/25 19:47:09 tl - ongoing ONE_LINGU implementation - - Revision 1.118 1999/10/22 11:06:41 os - index background with a lighter background - - Revision 1.117 1999/10/13 14:19:58 os - index background in light gray - - Revision 1.116 1999/08/31 08:46:22 TL - #if[n]def ONE_LINGU inserted (for transition of lingu to StarOne) - - - Rev 1.115 31 Aug 1999 10:46:22 TL - #if[n]def ONE_LINGU inserted (for transition of lingu to StarOne) - - Rev 1.114 09 Jun 1999 13:22:42 OS - index background - - Rev 1.113 19 May 1999 13:32:56 OS - #61245# DBG_ERROR, wenn Layout trotz CtrlAltL geladen wird - - Rev 1.112 27 Jan 1999 10:03:10 OS - #58677# Cursor in Readonly-Bereichen - - Rev 1.111 08 Sep 1998 16:49:52 OS - #56134# Metric fuer Text und HTML getrennt - - Rev 1.110 31 Aug 1998 11:19:14 OS - #55750# OnlineSpelling immer aus der OFA uebernehmen - - Rev 1.109 12 Jun 1998 09:44:14 OS - Konfigurationsnamen berichtigt - - Rev 1.108 29 Apr 1998 09:27:06 MA - BackgroundBrush -> RetoucheColor - - Rev 1.107 24 Nov 1997 17:58:48 MA - include - - Rev 1.106 11 Nov 1997 14:04:28 MA - precomp entfernt - - Rev 1.105 03 Nov 1997 16:12:36 JP - neu: Optionen/-Page/Basic-Schnittst. fuer ShadowCursor - - Rev 1.104 16 Sep 1997 13:23:10 OS - Color fuer VCL nicht konvertieren, fuer TextDocs Brush nie laden #43824# - - Rev 1.103 08 Aug 1997 16:11:40 OS - IDLE-Flag auch in der aktuellen Version im Load immer einschalten #42510# - - Rev 1.102 09 Jun 1997 14:28:44 MA - chg: Browse-Flag nur noch am Doc - - Rev 1.101 06 Jun 1997 12:44:14 MA - chg: versteckte Absaetze ausblenden - - Rev 1.100 31 Jan 1997 13:41:24 OS - alten Code fuer Metric geloescht - - Rev 1.99 27 Jan 1997 16:30:04 OS - HtmlMode entfernt - - Rev 1.98 13 Dec 1996 14:33:32 OS - UndoCount wird aus der SfxApp besorgt - - Rev 1.97 10 Dec 1996 16:58:48 OS - TabDist ab sofort in der OFA - - Rev 1.96 09 Dec 1996 17:02:02 OS - Grenzwerte fuer TblDest und Metric beim Load ueberpruefen - - Rev 1.95 28 Nov 1996 15:20:24 OS - neu: Schwarz drucken - - Rev 1.94 18 Nov 1996 10:26:22 OS - includes berichtigt - - Rev 1.93 11 Nov 1996 09:22:12 MA - ResMgr - - Rev 1.92 17 Oct 1996 16:43:44 OS - Altlasten der BrowseUsrPref entfernt - - Rev 1.91 25 Sep 1996 11:11:48 OS - IsTransparent wird jetzt auch gespeichert - - Rev 1.90 30 Aug 1996 08:44:06 OS - neu: sSymbolFont - - Rev 1.89 26 Aug 1996 16:56:10 OS - neu: Brush fuer BrowseView - - Rev 1.88 25 Jul 1996 15:35:36 OS - neu : HTML-Mode - - Rev 1.87 22 Jul 1996 15:06:30 OS - neu: ..EXECHYPERLINKS - - Rev 1.86 16 Jul 1996 20:19:50 MA - includes - - Rev 1.85 16 Jul 1996 15:52:20 MA - new: PrintPageBackground +/*-- 28.09.00 09:55:35--------------------------------------------------- - Rev 1.84 10 Jul 1996 12:01:26 OS - neu: nTblDest : Ziel fuer Tabellenhintergrund - - Rev 1.83 28 Jun 1996 10:11:42 OS - UseDefault: Basisklasse rufen - - Rev 1.82 07 May 1996 08:32:06 OS - im Laden der UsrPref Browse-Optionen absichern - - Rev 1.81 27 Apr 1996 14:53:14 OS - Idle-Flag im Load setzen - - Rev 1.80 26 Apr 1996 13:54:16 OS - Versionspruefung korrigiert - - Rev 1.79 25 Apr 1996 16:21:58 OS - ViewOptions ohne sal_Bool, dafuer massenweise defines - - Rev 1.78 24 Apr 1996 15:09:00 OS - Umstellung UsrPref/ViewOption - - Rev 1.77 25 Mar 1996 19:45:50 MA - wechsel product/non-product - - Rev 1.76 21 Mar 1996 12:51:50 OS - neu: bGrfKeepZoom fuer CropPage - - Rev 1.75 03 Mar 1996 16:48:48 MA - new: Flag fuer BrowseView - - Rev 1.74 27 Feb 1996 12:18:54 OS - Metric nicht mehr in den UsrPref - - Rev 1.73 23 Feb 1996 13:25:28 OS - neu: nUndoCount = UNDO_ACTION_COUNT - - Rev 1.72 20 Feb 1996 16:31:40 OS - neu: bKeepAspectRatio fuer Abgleich im Grafik/OLE-Dialog - - Rev 1.71 20 Feb 1996 11:01:52 AMA - New: bOnlineSpell und bHideSpell - - Rev 1.70 28 Nov 1995 22:36:04 JP - UiSystem-Klasse aufgehoben, in initui/swtypes aufgeteilt - - Rev 1.69 24 Nov 1995 16:58:52 OM - PCH->PRECOMPILED - - Rev 1.68 08 Nov 1995 12:48:16 OM - Change->Set - - Rev 1.67 03 Nov 1995 18:54:54 OS - vergessenes Table-Flag nachgetragen - - Rev 1.66 29 Sep 1995 16:58:40 OM - HelpPI entfernt - - Rev 1.65 17 Sep 1995 20:00:58 OS - neu: nUndoCount - - Rev 1.64 15 Sep 1995 12:40:20 OS - GetName() implementiert und ColorSetItem entfernt - - Rev 1.63 15 Aug 1995 17:04:52 OM - Preview-Zoomfaktor gesichert - - Rev 1.62 14 Jul 1995 09:57:22 MA - fix: TabDist ab Version B3 nicht groesser B3 - - Rev 1.61 13 Jul 1995 17:12:22 OS - DefaultAttribut fuer nTabDist holen - - Rev 1.60 13 Jul 1995 09:05:02 MA - fix: Tab zum x-ten, default fuer Load verbessert - - Rev 1.59 12 Jul 1995 11:31:00 MA - fix: Load(), TabDist fuer alte Versionen defaulten - - Rev 1.58 12 Jul 1995 10:49:42 MA - chg: MinTabDist ist MM50 - - Rev 1.57 11 Jul 1995 15:48:06 OS - neuer Member=>neue Version - - Rev 1.56 10 Jul 1995 19:27:32 OS - +nTabDist in Load, ::com::sun::star::ucb::Store, UseDefault - - Rev 1.55 25 Jun 1995 13:20:22 MA - opt: ViewOptions aufgeraeumt - - Rev 1.54 17 May 1995 17:26:06 MA - UsrPref: gefixt, aufgeraumt, optimiert, includes gerichtet. - - Rev 1.53 03 Apr 1995 19:56:36 OS - Einstellungen mehr als einmal laden - - Rev 1.52 20 Mar 1995 19:07:40 OS - unbenutzte Funktionen entfernt - - Rev 1.51 08 Mar 1995 03:56:52 OS - Raster-Einstellungen auch sichern - - Rev 1.50 19 Feb 1995 17:44:50 MA - SEXPORT'iert. - - Rev 1.49 25 Oct 1994 16:13:02 ER - add: PCH - - Rev 1.48 20 Oct 1994 12:54:42 JN - Versionskontrolle bei Load/Store - - Rev 1.47 05 Oct 1994 10:07:56 SWG - Anpassung Sfx - - Rev 1.46 15 Sep 1994 14:38:40 MS - Reanimation die 1. + -----------------------------------------------------------------------*/ +void SwLayoutViewConfig::Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames) +{ + Load(); +} +/*-- 28.09.00 09:55:36--------------------------------------------------- - Rev 1.45 15 Sep 1994 14:10:56 MS + -----------------------------------------------------------------------*/ +void SwLayoutViewConfig::Commit() +{ + Sequence<OUString> aNames = GetPropertyNames(); - Rev 1.44 04 Aug 1994 10:36:00 SWG - swg32: SED Size to SSize, LSize to Size etc. + OUString* pNames = aNames.getArray(); + Sequence<Any> aValues(aNames.getLength()); + Any* pValues = aValues.getArray(); -------------------------------------------------------------------------*/ + const Type& rType = ::getBooleanCppuType(); + for(int nProp = 0; nProp < aNames.getLength(); nProp++) + { + sal_Bool bSet; + switch(nProp) + { + case 0: bSet = rParent.IsSubsLines(); break;// "Line/TextBoundary", + case 1: bSet = rParent.IsSubsTable(); break;// "Line/TableBoundary", + case 2: bSet = rParent.IsSectionBounds(); break;// "Line/SectionBoundary", + case 3: bSet = rParent.IsCrossHair(); break;// "Line/Guide", + case 4: bSet = rParent.IsSolidMarkHdl(); break;// "Line/SimpleControlPoint", + case 5: bSet = rParent.IsBigMarkHdl(); break;// "Line/LargeControlPoint", + case 6: bSet = rParent.IsViewHScrollBar(); break;// "Window/HorizontalScroll", + case 7: bSet = rParent.IsViewVScrollBar(); break;// "Window/VerticalScroll", + case 8: bSet = rParent.IsViewTabwin(); break;// "Window/HorizontalRuler", + case 9: bSet = rParent.IsViewVLin(); break;// "Window/VerticalRuler", + case 10: bSet = rParent.IsSmoothScroll(); break;// "Window/SmoothScroll", + case 11: pValues[nProp] <<= (sal_Int32)rParent.GetMetric(); break;// "Other/MeasureUnit", + case 12: pValues[nProp] <<= rParent.GetDefTab(); break;// "Other/TabStop", + } + if(nProp < 11) + pValues[nProp].setValue(&bSet, ::getBooleanCppuType()); + } + PutProperties(aNames, aValues); +} +/*-- 28.09.00 09:55:36--------------------------------------------------- + -----------------------------------------------------------------------*/ +void SwLayoutViewConfig::Load() +{ + Sequence<OUString> aNames = GetPropertyNames(); + Sequence<Any> aValues = GetProperties(aNames); + EnableNotification(aNames); + const Any* pValues = aValues.getConstArray(); + DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed") + if(aValues.getLength() == aNames.getLength()) + { + for(int nProp = 0; nProp < aNames.getLength(); nProp++) + { + DBG_ASSERT(pValues[nProp].hasValue(), "property value missing") + if(pValues[nProp].hasValue()) + { + sal_Bool bSet = nProp < 11 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False; + switch(nProp) + { + case 0: rParent.SetSubsLines(bSet); break;// "Line/TextBoundary", + case 1: rParent.SetSubsTable(bSet); break;// "Line/TableBoundary", + case 2: rParent.SetSectionBounds(bSet); break;// "Line/SectionBoundary", + case 3: rParent.SetCrossHair(bSet); break;// "Line/Guide", + case 4: rParent.SetSolidMarkHdl(bSet); break;// "Line/SimpleControlPoint", + case 5: rParent.SetBigMarkHdl(bSet); break;// "Line/LargeControlPoint", + case 6: rParent.SetViewHScrollBar(bSet); break;// "Window/HorizontalScroll", + case 7: rParent.SetViewVScrollBar(bSet); break;// "Window/VerticalScroll", + case 8: rParent.SetViewTabwin(bSet); break;// "Window/HorizontalRuler", + case 9: rParent.SetViewVLin(bSet); break;// "Window/VerticalRuler", + case 10: rParent.SetSmoothScroll(bSet); break;// "Window/SmoothScroll", + case 11: + { + sal_Int32 nUnit; pValues[nProp] >>= nUnit; + rParent.SetMetric((FieldUnit)nUnit); + } + break;// "Other/MeasureUnit", + case 12: + { + sal_Int32 nTab; pValues[nProp] >>= nTab; + rParent.SetDefTab(nTab); + } + break;// "Other/TabStop", + } + } + } + } +} diff --git a/sw/source/ui/inc/usrpref.hxx b/sw/source/ui/inc/usrpref.hxx index d07bf0995459..2af0407ef83f 100644 --- a/sw/source/ui/inc/usrpref.hxx +++ b/sw/source/ui/inc/usrpref.hxx @@ -2,9 +2,9 @@ * * $RCSfile: usrpref.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:43 $ + * last change: $Author: os $ $Date: 2000-09-28 15:23:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,24 +62,126 @@ #define _USRPREF_HXX -#ifndef _SFXCFGITEM_HXX //autogen -#include <sfx2/cfgitem.hxx> + +#ifndef _UTL_CONFIGITEM_HXX_ +#include <unotools/configitem.hxx> +#endif +#ifndef _FLDUPDE_HXX +#include <fldupde.hxx> #endif #include "viewopt.hxx" -class SwMasterUsrPref: public SwViewOption, public SfxConfigItem +/* -----------------------------28.09.00 09:45-------------------------------- + + ---------------------------------------------------------------------------*/ +class SwMasterUsrPref; +class SwContentViewConfig : public utl::ConfigItem { -protected: - virtual int Load(SvStream&); - virtual BOOL Store(SvStream&); - virtual void UseDefault(); + SwMasterUsrPref& rParent; + BOOL bWeb; -public: - SwMasterUsrPref(USHORT nType); + com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames(); + public: + SwContentViewConfig(BOOL bWeb, SwMasterUsrPref& rParent); + ~SwContentViewConfig(); + + virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); + virtual void Commit(); + void Load(); + void SetModified(){ConfigItem::SetModified();} +}; +/* -----------------------------28.09.00 09:45-------------------------------- + + ---------------------------------------------------------------------------*/ +class SwLayoutViewConfig : public utl::ConfigItem +{ + SwMasterUsrPref& rParent; + BOOL bWeb; + + com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames(); + public: + SwLayoutViewConfig(BOOL bWeb, SwMasterUsrPref& rParent); + ~SwLayoutViewConfig(); + + virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); + virtual void Commit(); + void Load(); + void SetModified(){ConfigItem::SetModified();} +}; +/* -----------------------------28.09.00 09:45-------------------------------- + + ---------------------------------------------------------------------------*/ +class SwMasterUsrPref : public SwViewOption +{ + friend class SwContentViewConfig; + friend class SwLayoutViewConfig; + + SwContentViewConfig aContentConfig; + SwLayoutViewConfig aLayoutConfig; + + sal_Int32 nFldUpdateFlags; //udpate of fields and charts + sal_Int32 nLinkUpdateMode; + FieldUnit eUserMetric; - virtual String GetName() const; + sal_Int32 nDefTab; //default tab stop distance + +public: + SwMasterUsrPref(BOOL bWeb); void SetUsrPref(const SwViewOption &rCopy); + + void Commit() + { + aContentConfig.Commit(); + aLayoutConfig.Commit(); + } + void SetModified() + { + aContentConfig.SetModified(); + aLayoutConfig.SetModified(); + } + + void SetUpdateLinkMode(sal_Int32 nSet) {nLinkUpdateMode = nSet; SetModified();} + sal_Int32 GetUpdateLinkMode() const {return nLinkUpdateMode; } + + void SetUpdateFields(BOOL bSet) + { + if(bSet && nFldUpdateFlags == AUTOUPD_OFF) + { + nFldUpdateFlags = AUTOUPD_FIELD_ONLY; + SetModified(); + } + else if(!bSet) + { + nFldUpdateFlags = AUTOUPD_OFF; + SetModified(); + } + }; + sal_Bool IsUpdateFields()const {return nFldUpdateFlags != AUTOUPD_OFF; } + + sal_Int32 GetFldUpdateFlags()const {return nFldUpdateFlags;} + void SetFldUpdateFlags(sal_Int32 nSet){nFldUpdateFlags = nSet;} + + void SetUpdateCharts(BOOL bSet) + { + if(bSet) + { + nFldUpdateFlags = AUTOUPD_FIELD_AND_CHARTS; + SetModified(); + } + else if(nFldUpdateFlags == AUTOUPD_FIELD_AND_CHARTS) + { + nFldUpdateFlags = AUTOUPD_FIELD_ONLY; + SetModified(); + } + }; + sal_Bool IsUpdateCharts()const {return nFldUpdateFlags == AUTOUPD_FIELD_AND_CHARTS; } + + FieldUnit GetMetric() const { return eUserMetric;} + void SetMetric(FieldUnit eSet) { eUserMetric = eSet; SetModified();}; + + sal_Int32 GetDefTab() const { return nDefTab;} + void SetDefTab( sal_Int32 nSet ) { nDefTab = nSet; SetModified();} }; #endif diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index a67872868891..f132309f2c62 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pview.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:48 $ + * last change: $Author: os $ $Date: 2000-09-28 15:24:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -403,8 +403,8 @@ SwPreviewPrintOptionsDialog::SwPreviewPrintOptionsDialog( SwPagePreViewWin& rPar SwDocShell* pDocShell = rPreView.GetDocShell(); - const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); - FieldUnit eFieldUnit = pModOpt->GetMetric(0 != PTR_CAST(SwWebDocShell, pDocShell)); + const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(0 != PTR_CAST(SwWebDocShell, pDocShell)); + FieldUnit eFieldUnit = pUsrPref->GetMetric(); ::SetFieldUnit( aLSpaceMF, eFieldUnit ); ::SetFieldUnit( aRSpaceMF, eFieldUnit ); ::SetFieldUnit( aTSpaceMF, eFieldUnit ); @@ -1068,7 +1068,6 @@ void SwPagePreViewWin::SetPagePreview( BYTE nRow, BYTE nCol ) pOpt->SetPagePrevRow( nRow ); pOpt->SetPagePrevCol( nCol ); pOpt->SetModified(); - pOpt->SetDefault( FALSE ); //VScrollbar updaten! if( rView.StatVScrollbar() ) @@ -2221,6 +2220,9 @@ BOOL SwPagePreView::HandleWheelCommands( const CommandEvent& rCEvt ) /************************************************************************* $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:48 hr + initial import + Revision 1.201 2000/09/18 16:06:10 willem.vandorp OpenOffice header added. diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx index bc8a9467adde..87ff44450086 100644 --- a/sw/source/ui/uiview/viewmdi.cxx +++ b/sw/source/ui/uiview/viewmdi.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewmdi.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:49 $ + * last change: $Author: os $ $Date: 2000-09-28 15:24:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -188,7 +188,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, pUsrPref->SetZoom ( USHORT(nFac) ); pUsrPref->SetZoomType( BYTE( eZoomType ) ); SW_MOD()->ApplyUsrPref( *pUsrPref, 0 ); - pUsrPref->SetDefault ( FALSE ); + pUsrPref->SetModified(); } if ( pOpt->GetZoom() != (USHORT) nFac ) { @@ -711,6 +711,9 @@ void SwView::SetImageButtonColor(Color& rColor) /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:49 hr + initial import + Revision 1.126 2000/09/18 16:06:13 willem.vandorp OpenOffice header added. diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index 50376626c3e9..34b524e52285 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -2,9 +2,9 @@ * * $RCSfile: uitool.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:50 $ + * last change: $Author: os $ $Date: 2000-09-28 15:25:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -168,12 +168,12 @@ #ifndef _FMTCOL_HXX #include <fmtcol.hxx> #endif -#ifndef _MODCFG_HXX -#include <modcfg.hxx> -#endif #ifndef _POOLFMT_HXX #include <poolfmt.hxx> #endif +#ifndef _USRPREF_HXX +#include "usrpref.hxx" +#endif #ifndef _ERROR_H #include <error.h> @@ -703,7 +703,7 @@ void SwToSfxPageDescAttr( SfxItemSet& rCoreSet ) FieldUnit GetDfltMetric(BOOL bWeb) { - return SW_MOD()->GetModuleConfig()->GetMetric(bWeb); + return SW_MOD()->GetUsrPref(bWeb)->GetMetric(); } /*-------------------------------------------------------------------- @@ -713,24 +713,7 @@ FieldUnit GetDfltMetric(BOOL bWeb) void SetDfltMetric( FieldUnit eMetric, BOOL bWeb ) { - SwModuleOptions* pCfg = SW_MOD()->GetModuleConfig(); - FieldUnit eOldMetric = pCfg->GetMetric(bWeb); - if(eOldMetric != eMetric) - pCfg->SetMetric(eMetric, bWeb); - - SwView* pTmpView = SwModule::GetFirstView(); - - // fuer alle MDI-Fenster das Lineal umschalten - while(pTmpView) - { - if(bWeb == (0 != PTR_CAST(SwWebView, pTmpView))) - { - pTmpView->ChangeVLinealMetric(eMetric); - pTmpView->ChangeTabMetric(eMetric); - } - - pTmpView = SwModule::GetNextView(pTmpView); - } + SW_MOD()->ApplyUserMetric(eMetric, bWeb); } /*-----------------15.07.97 10:49------------------- @@ -895,6 +878,9 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, USHORT *pPercent, /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:50 hr + initial import + Revision 1.124 2000/09/18 16:06:19 willem.vandorp OpenOffice header added. |