summaryrefslogtreecommitdiff
path: root/sw/source
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
commit6cd7d7c69ce62fbf788fc4e971cb14ab24d4c5ed (patch)
tree1cc0baaacccb4f13124acf22adab93df32cac2eb /sw/source
parent497683efc24fa419dee4170cc32a4a1e39402f48 (diff)
Handle shadow option in frame painting.
Notes
Notes: split repo tag: writer_LO-BASE-INTEGRATION-DEV300_M101
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/layout/paintfrm.cxx11
-rw-r--r--sw/source/ui/config/viewopt.cxx12
2 files changed, 18 insertions, 5 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 4ce499522b18..f94cb8d9bdf1 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 374b207d8be6..648cd4cfb66a 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;