summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Le Ray <sebastien-libreoffice@orniz.org>2011-03-08 08:43:28 +0100
committerMichael Meeks <michael.meeks@novell.com>2011-03-08 12:00:01 +0000
commit1b63b7c2cb9ea29579c5982cce2aa0ac69093c24 (patch)
treeb6c5504674eacc9d657b2c0b19cb714d5d03b3d3
parent4e7e90f575657ba6096bc8ed11c6ee4d6f309fe8 (diff)
Handle shadow option in frame painting.LO-BASE-INTEGRATION-DEV300_M101
-rw-r--r--sw/inc/viewopt.hxx4
-rw-r--r--sw/source/core/layout/paintfrm.cxx11
-rw-r--r--sw/source/ui/config/viewopt.cxx12
3 files changed, 22 insertions, 5 deletions
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index c71bfb192e..2c4d2e7691 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -110,6 +110,7 @@ namespace svtools{ class ColorConfig;}
#define VIEWOPT_VISITED_LINKS 0x0020
#define VIEWOPT_FIELD_SHADINGS 0x0040
#define VIEWOPT_SECTION_BOUNDARIES 0x0080
+#define VIEWOPT_SHADOW 0x0100
// Implementierung in core/text/txtpaint.cxx
extern void SyncVout( const OutputDevice *pOut );
@@ -133,6 +134,7 @@ class SwViewOption
static Color aSectionBoundColor;
static Color aPageBreakColor;
static Color aScriptIndicatorColor;
+ static Color aShadowColor;
static sal_Int32 nAppearanceFlags; //
protected:
@@ -557,6 +559,7 @@ public:
static Color& GetTextGridColor();
static Color& GetSpellColor();
static Color& GetSmarttagColor();
+ static Color& GetShadowColor();
SW_DLLPUBLIC static Color& GetFontColor();
static Color& GetFieldShadingsColor();
static Color& GetSectionBoundColor();
@@ -572,6 +575,7 @@ public:
static BOOL IsVisitedLinks() {return IsAppearanceFlag(VIEWOPT_VISITED_LINKS );}
static BOOL IsFieldShadings() {return IsAppearanceFlag(VIEWOPT_FIELD_SHADINGS);}
static BOOL IsSectionBoundaries() {return IsAppearanceFlag(VIEWOPT_SECTION_BOUNDARIES);}
+ static BOOL IsShadow() {return IsAppearanceFlag(VIEWOPT_SHADOW );}
static void SetAppearanceFlag(sal_Int32 nFlag, BOOL bSet, BOOL bSaveInConfig = FALSE);
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 13b51d301e..da5e5db8ab 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5299,20 +5299,23 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10;
bool bFullBottomShadow,
bool bRightSidebar )
{
+ // No shadow in prefs
+ if( !SwViewOption::IsShadow() ) return;
+
// --> FME 2004-06-24 #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *_pViewShell->GetOut() );
// <--
- static bool initialized = false;
static BitmapEx aPageTopRightShadow;
static BitmapEx aPageBottomRightShadow;
static BitmapEx aPageBottomLeftShadow;
static BitmapEx aPageBottomShadowBase;
static BitmapEx aPageRightShadowBase;
- static Color aShadowColor( COL_BLACK );
+ static Color aShadowColor;
- if(!initialized) {
+ if(aShadowColor != SwViewOption::GetShadowColor() ) {
+ aShadowColor = SwViewOption::GetShadowColor();
AlphaMask aMask( SW_RES( BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK ) );
Bitmap aFilledSquare( Size( mnShadowPxWidth, mnShadowPxWidth ), 24 );
aFilledSquare.Erase( aShadowColor );
@@ -5332,8 +5335,6 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 10;
aFilledSquare.Erase( aShadowColor );
aMask = Bitmap( SW_RES( BMP_PAGE_RIGHT_SHADOW_MASK ) );
aPageRightShadowBase = BitmapEx( aFilledSquare, aMask );
-
- initialized = true;
}
SwRect aPaintRect;
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index 18a1a238ac..a0db43d368 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -72,6 +72,7 @@ Color SwViewOption::aFieldShadingsColor(COL_LIGHTGRAY);
Color SwViewOption::aSectionBoundColor(COL_LIGHTGRAY);
Color SwViewOption::aPageBreakColor(COL_BLUE);
Color SwViewOption::aScriptIndicatorColor(COL_GREEN);
+Color SwViewOption::aShadowColor(COL_GRAY);
sal_Int32 SwViewOption::nAppearanceFlags = VIEWOPT_DOC_BOUNDARIES|VIEWOPT_OBJECT_BOUNDARIES;
USHORT SwViewOption::nPixelTwips = 0; // one pixel on the screen
@@ -418,6 +419,11 @@ Color& SwViewOption::GetSmarttagColor()
return aSmarttagColor;
}
+Color& SwViewOption::GetShadowColor()
+{
+ return aShadowColor;
+}
+
Color& SwViewOption::GetFontColor()
{
return aFontColor;
@@ -475,6 +481,11 @@ void SwViewOption::ApplyColorConfigValues(const svtools::ColorConfig& rConfig )
if(aValue.bIsVisible)
nAppearanceFlags |= VIEWOPT_VISITED_LINKS;
+ aValue = rConfig.GetColorValue(svtools::SHADOWCOLOR);
+ aShadowColor.SetColor(aValue.nColor);
+ if(aValue.bIsVisible)
+ nAppearanceFlags |= VIEWOPT_SHADOW;
+
aDirectCursorColor.SetColor(rConfig.GetColorValue(svtools::WRITERDIRECTCURSOR).nColor);
aTextGridColor.SetColor(rConfig.GetColorValue(svtools::WRITERTEXTGRID).nColor);
@@ -526,6 +537,7 @@ void SwViewOption::SetAppearanceFlag(sal_Int32 nFlag, BOOL bSet, BOOL bSaveInCon
{ VIEWOPT_VISITED_LINKS , svtools::LINKSVISITED },
{ VIEWOPT_FIELD_SHADINGS , svtools::WRITERFIELDSHADINGS },
{ VIEWOPT_SECTION_BOUNDARIES , svtools::WRITERSECTIONBOUNDARIES },
+ { VIEWOPT_SHADOW , svtools::SHADOWCOLOR },
{ 0 , svtools::ColorConfigEntryCount }
};
sal_uInt16 nPos = 0;