diff options
author | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-11-10 13:50:33 +0800 |
---|---|---|
committer | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-11-10 13:50:33 +0800 |
commit | fa1f3c352c6126b24ab5af87ea4ebea742c546c2 (patch) | |
tree | 5a5240e4969fee626bb060bd386fceb957081f90 /svx/source/sdr | |
parent | d0097a3f35e5e2c68d293d604a2f6f51b2d822a5 (diff) | |
parent | 3c21373571fd0cf89391502aa132c5f420cd75c6 (diff) |
removetooltypes01: #i112600# resync to DEV300_m92; remove tooltypes from xmloff, linguistic, vcl, svtools, accessibility, fpicker, uui and framework
Diffstat (limited to 'svx/source/sdr')
6 files changed, 93 insertions, 52 deletions
diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx index cbe9c4a9c615..6ca5f1c4d172 100644 --- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx +++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx @@ -62,23 +62,7 @@ namespace sdr { drawinglayer::primitive2d::Primitive2DSequence xRetval; drawinglayer::attribute::SdrFillAttribute aFill; - const SdrPage* pCorrectPage = &GetMasterPageDescriptor().GetOwnerPage(); - const SdrPageProperties* pCorrectProperties = &pCorrectPage->getSdrPageProperties(); - - if(XFILL_NONE == ((const XFillStyleItem&)pCorrectProperties->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue()) - { - pCorrectPage = &GetMasterPageDescriptor().GetUsedPage(); - pCorrectProperties = &pCorrectPage->getSdrPageProperties(); - } - - if(pCorrectPage->IsMasterPage() && !pCorrectProperties->GetStyleSheet()) - { - // #i110846# Suppress SdrPage FillStyle for MasterPages without StyleSheets, - // else the PoolDefault (XFILL_COLOR and Blue8) will be used. Normally, all - // MasterPages should have a StyleSheet excactly for this reason, but historically - // e.g. the Notes MasterPage has no StyleSheet set (and there maybe others). - pCorrectProperties = 0; - } + const SdrPageProperties* pCorrectProperties = GetMasterPageDescriptor().getCorrectSdrPageProperties(); if(pCorrectProperties) { 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/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx index 5ef26193d4b3..34731f100b5d 100644 --- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx @@ -273,9 +273,16 @@ namespace sdr // init extractor, guarantee existance, set page there mpExtractor->SetStartPage(pPage); + // #i105548# also need to copy the VOCRedirector for sub-content creation + mpExtractor->SetViewObjectContactRedirector(GetObjectContact().GetViewObjectContactRedirector()); + // create page content xPageContent = mpExtractor->createPrimitive2DSequenceForPage(rDisplayInfo); + // #i105548# reset VOCRedirector to not accidentially have a pointer to a + // temporary class, so calls to it are avoided safely + mpExtractor->SetViewObjectContactRedirector(0); + // reset recursion flag bInCreatePrimitive2D = false; } 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/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index 2320944afd03..089f75aa8ade 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -77,8 +77,16 @@ namespace if(pPage && pPage->GetModel()) { - const sal_uInt16 nPageCount(pPage->GetModel()->GetPageCount()); - nRetval = ((sal_Int16)nPageCount - 1) / 2; + if( (pPage->GetPageNum() == 0) && !pPage->IsMasterPage() ) + { + // handout page! + return pPage->GetModel()->getHandoutPageCount(); + } + else + { + const sal_uInt16 nPageCount(pPage->GetModel()->GetPageCount()); + nRetval = ((sal_Int16)nPageCount - 1) / 2; + } } return nRetval; diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index 348c319e256e..091656e1f261 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -185,18 +185,21 @@ namespace sdr { SdrText* pText = rObj.getText( nCount ); OutlinerParaObject* pParaObj = pText->GetOutlinerParaObject(); - rOutliner.SetText(*pParaObj); - sal_uInt32 nParaCount(rOutliner.GetParagraphCount()); - - if(nParaCount) + if( pParaObj ) { - ESelection aSelection( 0, 0, EE_PARA_ALL, EE_PARA_ALL); - rOutliner.RemoveAttribs(aSelection, sal_True, 0); + rOutliner.SetText(*pParaObj); + sal_uInt32 nParaCount(rOutliner.GetParagraphCount()); - OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount); - rOutliner.Clear(); + if(nParaCount) + { + ESelection aSelection( 0, 0, EE_PARA_ALL, EE_PARA_ALL); + rOutliner.RemoveAttribs(aSelection, sal_True, 0); - rObj.NbcSetOutlinerParaObjectForText( pTemp, pText ); + OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount); + rOutliner.Clear(); + + rObj.NbcSetOutlinerParaObjectForText( pTemp, pText ); + } } } } |