#97695# use color configuration

This commit is contained in:
Oliver Specht 2002-04-12 09:39:11 +00:00
parent eb836c9aa8
commit 310c332e9a
7 changed files with 111 additions and 191 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: swmodule.hxx,v $
*
* $Revision: 1.12 $
* $Revision: 1.13 $
*
* last change: $Author: tl $ $Date: 2002-02-19 13:42:29 $
* last change: $Author: os $ $Date: 2002-04-12 10:39:11 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -107,6 +107,7 @@ class SwNavigationConfig;
class SwTransferable;
class SwToolbarConfigItem;
class SwAttrPool;
namespace svx{ class ColorConfig;}
struct SwDBData;
#define VIEWOPT_DEST_VIEW 0
#define VIEWOPT_DEST_TEXT 1
@ -134,6 +135,7 @@ class SwModule: public SwModuleDummy , public SfxListener
SwToolbarConfigItem*pToolbarConfig; //fuer gestackte Toolbars, welche
SwToolbarConfigItem*pWebToolbarConfig; //war sichtbar?
SwDBConfig* pDBConfig;
svx::ColorConfig* pColorConfig;
SfxErrorHandler* pErrorHdl;
@ -222,6 +224,7 @@ public:
SwToolbarConfigItem*GetToolbarConfig() { return pToolbarConfig; }
SwToolbarConfigItem*GetWebToolbarConfig() { return pWebToolbarConfig; }
SwDBConfig* GetDBConfig();
svx::ColorConfig& GetColorConfig();
// UNO
// virtual Reflection* GetReflection( UsrUik aUIK );

View file

@ -2,9 +2,9 @@
*
* $RCSfile: viewopt.hxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: os $ $Date: 2002-03-07 08:56:20 $
* last change: $Author: os $ $Date: 2002-04-12 10:38:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -156,6 +156,7 @@ extern void SyncVout( const OutputDevice *pOut );
class SwViewOption
{
static Color aSpellColor; // mark color of online spell checking
protected:
static USHORT nPixelTwips;// 1 Pixel == ? Twips
@ -294,7 +295,7 @@ public:
inline void SetPostIts( BOOL b )
{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_POSTITS ) : ( nCoreOptions &= ~VIEWOPT_1_POSTITS); }
void PaintPostIts( OutputDevice *pOut, const SwRect &rRect,
long nCol ) const;
sal_Bool bIsScript ) const;
USHORT GetPostItsWidth( const OutputDevice *pOut = 0 ) const;
inline BOOL IsHidden() const
@ -565,6 +566,9 @@ public:
const Color& GetIndexBackgrndColor() const { return aIdxBackgrndCol;}
void SetIndexBackgrndColor(const Color& rCol) {aIdxBackgrndCol = rCol;}
static Color& GetSpellColor();
static void SetSpellColor(ColorData nColor);
};

View file

@ -2,9 +2,9 @@
*
* $RCSfile: fntcache.hxx,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: fme $ $Date: 2001-07-10 15:13:43 $
* last change: $Author: os $ $Date: 2002-04-12 10:38:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -109,7 +109,6 @@ public:
extern SwFntCache *pFntCache;
extern SwFntObj *pLastFont;
extern BYTE *pMagicNo;
extern Color *pSpellCol;
extern Color *pWaveCol;
/*************************************************************************

View file

@ -2,9 +2,9 @@
*
* $RCSfile: viewsh.cxx,v $
*
* $Revision: 1.19 $
* $Revision: 1.20 $
*
* last change: $Author: ama $ $Date: 2002-04-08 14:33:17 $
* last change: $Author: os $ $Date: 2002-04-12 10:36:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -89,6 +89,9 @@
#ifndef _SWMODULE_HXX
#include <swmodule.hxx>
#endif
#ifndef _SVX_COLORCFG_HXX
#include <svx/colorcfg.hxx>
#endif
#ifndef _FESH_HXX
#include <fesh.hxx>
#endif
@ -1394,7 +1397,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
void ViewShell::_PaintDesktop( const SwRegionRects &rRegion )
{
GetOut()->Push( PUSH_FILLCOLOR );
GetOut()->SetFillColor( Color(RGB_COLORDATA( 0xE0, 0xE0, 0xE0 )) );
GetOut()->SetFillColor( Color(SW_MOD()->GetColorConfig().GetColorValue(svx::APPBACKGROUND).nColor) );
for ( USHORT i = 0; i < rRegion.Count(); ++i )
GetOut()->DrawRect( rRegion[i].SVRect() );
GetOut()->Pop();

View file

@ -2,9 +2,9 @@
*
* $RCSfile: apphdl.cxx,v $
*
* $Revision: 1.18 $
* $Revision: 1.19 $
*
* last change: $Author: tl $ $Date: 2001-09-18 11:19:29 $
* last change: $Author: os $ $Date: 2002-04-12 10:37:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -94,6 +94,9 @@
#ifndef _SVX_SRCHITEM_HXX
#include <svx/srchitem.hxx>
#endif
#ifndef _SVX_COLORCFG_HXX
#include <svx/colorcfg.hxx>
#endif
#ifndef _SFXENUMITEM_HXX //autogen
#include <svtools/eitem.hxx>
#endif
@ -146,6 +149,12 @@
#ifndef _VIEW_HXX
#include <view.hxx>
#endif
#ifndef _SWPVIEW_HXX
#include <pview.hxx>
#endif
#ifndef _SRCVIEW_HXX
#include <srcview.hxx>
#endif
#ifndef _WRTSH_HXX
#include <wrtsh.hxx>
#endif
@ -1007,28 +1016,53 @@ void SwModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
GetItemState( SID_ATTR_ADDRESS, sal_False ))
bAuthorInitialised = FALSE;
}
else if(rHint.ISA(SfxSimpleHint) &&
((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DEINITIALIZING)
else if(rHint.ISA(SfxSimpleHint))
{
if(pSrcViewConfig)
ULONG nHintId = ((SfxSimpleHint&)rHint).GetId();
if(SFX_HINT_COLORS_CHANGED == nHintId)
{
if(pSrcViewConfig->IsModified())
pSrcViewConfig->Commit();
DELETEZ( pSrcViewConfig );
}
SwViewOption::SetSpellColor(pColorConfig->GetColorValue(svx::WRITERSPELL).nColor);
//invalidate all edit windows
const TypeId aSwViewTypeId = TYPE(SwView);
const TypeId aSwPreViewTypeId = TYPE(SwPagePreView);
const TypeId aSwSrcViewTypeId = TYPE(SwSrcView);
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while(pViewShell)
{
if(pViewShell->GetWindow() &&
(pViewShell->IsA(aSwViewTypeId) ||
pViewShell->IsA(aSwViewTypeId) ||
pViewShell->IsA(aSwViewTypeId)))
pViewShell->GetWindow()->Invalidate();
pViewShell = SfxViewShell::GetNext( *pViewShell );
}
DELETEZ(pWebUsrPref);
DELETEZ(pUsrPref) ;
DELETEZ(pModuleConfig);
DELETEZ(pPrtOpt) ;
DELETEZ(pWebPrtOpt) ;
DELETEZ(pChapterNumRules);
DELETEZ(pStdFontConfig) ;
DELETEZ(pNavigationConfig) ;
DELETEZ(pToolbarConfig) ;
DELETEZ(pWebToolbarConfig) ;
DELETEZ(pAuthorNames) ;
DELETEZ(pDBConfig);
}
else if(SFX_HINT_DEINITIALIZING == nHintId)
{
if(pSrcViewConfig)
{
if(pSrcViewConfig->IsModified())
pSrcViewConfig->Commit();
DELETEZ( pSrcViewConfig );
}
DELETEZ(pWebUsrPref);
DELETEZ(pUsrPref) ;
DELETEZ(pModuleConfig);
DELETEZ(pPrtOpt) ;
DELETEZ(pWebPrtOpt) ;
DELETEZ(pChapterNumRules);
DELETEZ(pStdFontConfig) ;
DELETEZ(pNavigationConfig) ;
DELETEZ(pToolbarConfig) ;
DELETEZ(pWebToolbarConfig) ;
DELETEZ(pAuthorNames) ;
DELETEZ(pDBConfig);
EndListening(*pColorConfig);
DELETEZ(pColorConfig);
}
}
}
void SwModule::FillStatusBar( StatusBar& rStatusBar )
@ -1101,6 +1135,17 @@ SwDBConfig* SwModule::GetDBConfig()
pDBConfig = new SwDBConfig;
return pDBConfig;
}
/* -----------------------------11.04.2002 15:27------------------------------
---------------------------------------------------------------------------*/
svx::ColorConfig& SwModule::GetColorConfig()
{
if(!pColorConfig)
pColorConfig = new svx::ColorConfig;
StartListening(*pColorConfig);
SwViewOption::SetSpellColor(pColorConfig->GetColorValue(svx::WRITERSPELL).nColor);
return *pColorConfig;
}
/*-----------------30.01.97 08.30-------------------
--------------------------------------------------*/

View file

@ -2,9 +2,9 @@
*
* $RCSfile: swmodule.cxx,v $
*
* $Revision: 1.22 $
* $Revision: 1.23 $
*
* last change: $Author: tl $ $Date: 2002-02-19 13:45:46 $
* last change: $Author: os $ $Date: 2002-04-12 10:37:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -394,6 +394,7 @@ SwModule::SwModule( SvFactory* pFact,
pToolbarConfig(0),
pWebToolbarConfig(0),
pDBConfig(0),
pColorConfig(0),
pClipboard(0),
pDragDrop(0),
pXSelection(0),

View file

@ -2,9 +2,9 @@
*
* $RCSfile: viewopt.cxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: ama $ $Date: 2001-07-05 13:48:54 $
* last change: $Author: os $ $Date: 2002-04-12 10:37:11 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -95,7 +95,9 @@
#ifndef _WINDOW_HXX //autogen
#include <vcl/window.hxx>
#endif
#ifndef _SWMODULE_HXX //autogen
#include <swmodule.hxx>
#endif
#ifndef _SWTYPES_HXX
#include <swtypes.hxx>
#endif
@ -116,6 +118,8 @@
#ifndef PRODUCT
BOOL SwViewOption::bTest9 = FALSE; //DrawingLayerNotLoading
#endif
Color SwViewOption::aSpellColor(COL_LIGHTRED);
USHORT SwViewOption::nPixelTwips = 0; //ein Pixel auf dem Bildschirm
@ -413,7 +417,7 @@ USHORT SwViewOption::GetPostItsWidth( const OutputDevice *pOut ) const
*************************************************************************/
void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect,
long nCol ) const
sal_Bool bIsScript ) const
{
if( pOut )
{
@ -426,7 +430,8 @@ void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect,
const Point aTopLeft( rRect.Left() + nPix, rRect.Top() + nPix );
const Point aBotRight( rRect.Right() - nPix, rRect.Bottom() - nPix );
const SwRect aRect( aTopLeft, aBotRight );
DrawRect( pOut, aRect, nCol );
sal_Int32 nColor = bIsScript ? COL_LIGHTGREEN : COL_YELLOW;
DrawRect( pOut, aRect, nColor );
pOut->SetLineColor( aOldLineColor );
}
}
@ -627,158 +632,18 @@ USHORT GetHtmlMode(const SwDocShell* pShell)
}
return nRet;
}
/* -----------------------------12.04.2002 10:39------------------------------
---------------------------------------------------------------------------*/
Color& SwViewOption::GetSpellColor()
{
return aSpellColor;
}
/* -----------------------------12.04.2002 10:41------------------------------
/************************************************************************
$Log: not supported by cvs2svn $
Revision 1.3 2001/04/27 17:47:50 jp
remove unused line
Revision 1.2 2000/11/20 09:07:00 jp
should change: use LocaleDataWrapper
Revision 1.1.1.1 2000/09/18 17:14:33 hr
initial import
Revision 1.57 2000/09/18 16:05:18 willem.vandorp
OpenOffice header added.
Revision 1.56 2000/04/11 08:02:24 os
UNICODE
Revision 1.55 2000/03/03 15:16:59 os
StarView remainders removed
Revision 1.54 2000/01/19 18:24:09 jp
Bug #72118#: change default of view sectionboundaries
Revision 1.53 2000/01/13 21:28:44 jp
Task #71894#: new Options for SW-AutoComplete
Revision 1.52 1999/09/20 10:35:00 os
Color changes
Revision 1.51 1999/07/28 11:03:20 OS
index background in lighter gray
Rev 1.50 28 Jul 1999 13:03:20 OS
index background in lighter gray
Rev 1.49 13 Jul 1999 08:47:52 OS
#67584# Scrollbar settings via StarOne
Rev 1.48 09 Jun 1999 13:22:34 OS
index background
Rev 1.47 17 Mar 1999 11:24:10 JP
Task #63576#: IsAutoCompleteWords - das Flag von der OffApp erfragen
Rev 1.46 15 Mar 1999 09:47:52 MA
#63047# neue Defaults
Rev 1.45 09 Mar 1999 19:34:34 JP
Task #61405#: AutoCompletion von Woertern
Rev 1.44 19 Jan 1999 08:47:36 MIB
#60957#: Kapitaelchen auch fuer IE4
Rev 1.43 29 Apr 1998 09:27:06 MA
BackgroundBrush -> RetoucheColor
Rev 1.42 20 Apr 1998 09:10:42 OS
IE3 entfaellt
Rev 1.41 03 Apr 1998 14:42:22 OS
HTMLMODE_SOME/FULL_ABS_POS
Rev 1.40 05 Mar 1998 14:34:12 OM
Redline-Attribute in Module-Cfg speichern
Rev 1.39 23 Feb 1998 12:40:46 OM
Redlining-Optionen
Rev 1.38 04 Feb 1998 17:53:06 MA
chg: Notiz wieder per default an
Rev 1.37 09 Jan 1998 17:15:14 AMA
Fix #46523#: Colors sollten als long durchgereicht werden...
Rev 1.36 28 Nov 1997 15:24:22 MA
includes
Rev 1.35 24 Nov 1997 17:58:48 MA
include
Rev 1.34 03 Nov 1997 16:12:36 JP
neu: Optionen/-Page/Basic-Schnittst. fuer ShadowCursor
Rev 1.33 01 Sep 1997 13:16:58 OS
DLL-Umstellung
Rev 1.32 08 Aug 1997 17:37:24 OM
Headerfile-Umstellung
Rev 1.31 05 Aug 1997 14:52:06 OS
Option fuer Grafikhintergrund #41663#
Rev 1.30 02 Jul 1997 12:46:00 MA
inlines
Rev 1.29 17 Jun 1997 17:24:06 MIB
HTML-Modus-Flgas fuer Netacpe 4.0
Rev 1.28 06 Jun 1997 12:44:24 MA
chg: versteckte Absaetze ausblenden
Rev 1.27 05 May 1997 10:56:32 AMA
Fix #39418#: Tabulatorsymbolgroesse jetzt zoomabhaengig.
Rev 1.26 25 Feb 1997 09:11:14 MA
chg: Option fuer SolidHdl
Rev 1.25 13 Feb 1997 18:57:16 AMA
New: JavaScript-Felder werden gruen dargestellt.
Rev 1.24 07 Feb 1997 18:25:30 OS
HtmlMode auch fuer pDocSh == 0; Flags berichtigt
Rev 1.23 05 Feb 1997 13:44:18 OS
HTML-Modi erweitert
Rev 1.22 27 Jan 1997 16:33:52 OS
GetHtmlMode wird mit der DocShell ermittelt
Rev 1.21 08 Jan 1997 10:47:10 OS
neu: ::GetHtmlMode()
Rev 1.20 13 Dec 1996 14:33:32 OS
UndoCount wird aus der SfxApp besorgt
Rev 1.19 10 Dec 1996 16:58:46 OS
TabDist ab sofort in der OFA
Rev 1.18 28 Nov 1996 15:20:24 OS
neu: Schwarz drucken
Rev 1.17 25 Sep 1996 14:56:18 OS
Linealabfragen nicht mehr inline
Rev 1.16 19 Sep 1996 18:40:54 OS
SetUIOptions enthaelt auch nTblDest
Rev 1.15 06 Sep 1996 14:32:20 OS
UsrPrefs wieder vereinheitlicht
Rev 1.14 30 Aug 1996 08:44:04 OS
neu: sSymbolFont
Rev 1.13 27 Aug 1996 10:11:44 OS
IsEqualFlags: Brush vergleichen
Rev 1.12 27 Aug 1996 09:44:46 OS
operator=
*************************************************************************/
---------------------------------------------------------------------------*/
void SwViewOption::SetSpellColor(ColorData nColor)
{
aSpellColor.SetColor(nColor);
}