diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-08-26 09:15:18 +0200 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-08-26 09:15:18 +0200 |
commit | 1e37c007736fb550b3e43a5aada15220263f7376 (patch) | |
tree | 187e06dd582774519213f1f41c150ba7e005826c /svx | |
parent | a65ca79f2a3b044f8e920c191445f010e6da255d (diff) | |
parent | b8d78852acfa632daa32d5827d0ee64fd6102c80 (diff) |
CWS-TOOLING: integrate CWS renaissance1
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svdstr.hrc | 1 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewcontactofsdrpage.cxx | 81 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdstr.src | 5 |
4 files changed, 69 insertions, 24 deletions
diff --git a/svx/inc/svdstr.hrc b/svx/inc/svdstr.hrc index f1bc8cfdae19..d778bf40326b 100644 --- a/svx/inc/svdstr.hrc +++ b/svx/inc/svdstr.hrc @@ -756,6 +756,7 @@ //BFS01#define SIP_SDRATTRSET_GRAF (SIP_Begin + 258) #define SIP_SA_MARKERS (SIP_Begin + 258) +#define SIP_SA_PAGESHADOW35X35 (SIP_Begin + 259) #define SIP_SA_FINE_MARKERS (SIP_Begin + 260) // #100499# diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index b80b6fcbba88..ad65b647001e 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -44,6 +44,10 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <svx/sdr/primitive2d/sdrattributecreator.hxx> #include <svx/sdr/primitive2d/sdrdecompositiontools.hxx> +#include <vcl/lazydelete.hxx> +#include "svdstr.hrc" +#include "svdglob.hxx" +#include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx> #include <drawinglayer/attribute/sdrfillattribute.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -131,31 +135,54 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageShadow::createViewIndependentPrimitive2DSequence() const { + static bool bUseOldPageShadow(false); const SdrPage& rPage = getPage(); basegfx::B2DHomMatrix aPageMatrix; aPageMatrix.set(0, 0, (double)rPage.GetWdt()); aPageMatrix.set(1, 1, (double)rPage.GetHgt()); - // create page shadow polygon - const double fPageBorderFactor(1.0 / 256.0); - basegfx::B2DPolygon aPageShadowPolygon; - aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0)); - aPageShadowPolygon.setClosed(true); - aPageShadowPolygon.transform(aPageMatrix); - - // We have only the page information, not the view information. Use the - // svtools::FONTCOLOR color for initialisation - const svtools::ColorConfig aColorConfig; - const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); - const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPageShadowPolygon), aRGBShadowColor)); + if(bUseOldPageShadow) + { + // create page shadow polygon + const double fPageBorderFactor(1.0 / 256.0); + basegfx::B2DPolygon aPageShadowPolygon; + aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0)); + aPageShadowPolygon.setClosed(true); + aPageShadowPolygon.transform(aPageMatrix); + + // We have only the page information, not the view information. Use the + // svtools::FONTCOLOR color for initialisation + const svtools::ColorConfig aColorConfig; + const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); + const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aPageShadowPolygon), + aRGBShadowColor)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } + else + { + static vcl::DeleteOnDeinit<drawinglayer::primitive2d::DiscreteShadow> + aDiscreteShadow(new drawinglayer::primitive2d::DiscreteShadow( + BitmapEx(ResId(SIP_SA_PAGESHADOW35X35, *ImpGetResMgr())))); + if (aDiscreteShadow.get() != NULL) + { + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::DiscreteShadowPrimitive2D( + aPageMatrix, + *aDiscreteShadow.get())); - return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } + return drawinglayer::primitive2d::Primitive2DSequence(); + } } ViewContactOfPageShadow::ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage) @@ -313,11 +340,17 @@ namespace sdr const SdrPage& rPage = getPage(); const basegfx::B2DRange aPageBorderRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt()); - // We have only the page information, not the view information. Use the - // svtools::FONTCOLOR color for initialisation - const svtools::ColorConfig aColorConfig; - const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); - const basegfx::BColor aRGBBorderColor(aBorderColor.getBColor()); + // Changed to 0x949599 for renaissance, before svtools::FONTCOLOR was used. + // Added old case as fallback for HighContrast. + basegfx::BColor aRGBBorderColor(0x94 / (double)0xff, 0x95 / (double)0xff, 0x99 / (double)0xff); + + if(Application::GetSettings().GetStyleSettings().GetHighContrastMode()) + { + const svtools::ColorConfig aColorConfig; + const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); + + aRGBBorderColor = aBorderColor.getBColor(); + } if(rPage.getPageBorderOnlyLeftRight()) { diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx index c751ba2ada76..f7145dcd9d73 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx @@ -320,6 +320,12 @@ namespace sdr return false; } + // no page shadow for high contrast mode + if(GetObjectContact().isDrawModeHighContrast()) + { + return false; + } + return true; } } // end of namespace contact diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src index 1317a0e1328d..000e20cf24d4 100644 --- a/svx/source/svdraw/svdstr.src +++ b/svx/source/svdraw/svdstr.src @@ -2746,6 +2746,11 @@ String SIP_SA_GRAFRESERVE4 { Text = "" ; }; String SIP_SA_GRAFRESERVE5 { Text = "" ; }; String SIP_SA_GRAFRESERVE6 { Text = "" ; }; +Bitmap SIP_SA_PAGESHADOW35X35 +{ + File = "pageshadow35x35.png"; +}; + Bitmap SIP_SA_MARKERS { File = "markers.bmp"; |