diff options
Diffstat (limited to 'svx')
71 files changed, 708 insertions, 573 deletions
diff --git a/svx/inc/svx/fmmodel.hxx b/svx/inc/svx/fmmodel.hxx index 2a11234085..d92f925cdf 100644 --- a/svx/inc/svx/fmmodel.hxx +++ b/svx/inc/svx/fmmodel.hxx @@ -89,14 +89,16 @@ public: /** check whether the OpenInDesignMode has been set explicitly or been loaded (<FALSE/>) or if it still has the default value from construction (<TRUE/>) */ - sal_Bool OpenInDesignModeIsDefaulted( ); + sal_Bool OpenInDesignModeIsDefaulted(); -//#if 0 // _SOLAR__PRIVATE - void implSetOpenInDesignMode( sal_Bool _bOpenDesignMode, sal_Bool _bForce ); + /** determines whether form controls should use the SdrModel's reference device for text rendering + */ + sal_Bool ControlsUseRefDevice() const; FmXUndoEnvironment& GetUndoEnv(); -//#endif +private: + void implSetOpenInDesignMode( sal_Bool _bOpenDesignMode, sal_Bool _bForce ); }; #endif // _FM_FMMODEL_HXX diff --git a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx index 09da0ee8ee..2193dd63af 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx @@ -56,8 +56,13 @@ namespace drawinglayer // defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means // that the text needs to be block formatted unsigned mbWordWrap : 1; - // #SJ# Allow text clipping against TextBox in special cases (used for SC)
- unsigned mbForceTextClipToTextRange : 1;
+ + // #SJ# Allow text clipping against TextBox in special cases (used for SC) + unsigned mbForceTextClipToTextRange : 1; + + // defines that the object contains/is a 3D AutoShape. Needed for + // making exceptions with shadow generation + unsigned mb3DShape : 1; protected: // local decomposition. @@ -69,7 +74,8 @@ namespace drawinglayer const Primitive2DSequence& rSubPrimitives, const basegfx::B2DHomMatrix& rTextBox, bool bWordWrap, - bool bForceTextClipToTextRange); + bool bForceTextClipToTextRange, + bool b3DShape); // data access const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; } @@ -77,6 +83,7 @@ namespace drawinglayer const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; } bool getWordWrap() const { return mbWordWrap; } bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; } + bool get3DShape() const { return mb3DShape; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; diff --git a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx index 3e31be61ca..f228d6c1c7 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx @@ -39,19 +39,19 @@ ////////////////////////////////////////////////////////////////////////////// // predefines -namespace drawinglayer -{ - namespace primitive2d +namespace drawinglayer { namespace primitive2d { + enum MeasureTextPosition { - enum MeasureTextPosition - { - MEASURETEXTPOSITION_AUTOMATIC, - MEASURETEXTPOSITION_NEGATIVE, - MEASURETEXTPOSITION_CENTERED, - MEASURETEXTPOSITION_POSITIVE - }; - } // end of namespace primitive2d -} // end of namespace drawinglayer + MEASURETEXTPOSITION_AUTOMATIC, + MEASURETEXTPOSITION_NEGATIVE, + MEASURETEXTPOSITION_CENTERED, + MEASURETEXTPOSITION_POSITIVE + }; +}} + +namespace drawinglayer { namespace attribute { + class SdrLineAttribute; +}} ////////////////////////////////////////////////////////////////////////////// @@ -80,6 +80,7 @@ namespace drawinglayer // internal decomposition helper Primitive2DReference impCreatePart( + const attribute::SdrLineAttribute& rLineAttribute, const basegfx::B2DHomMatrix& rObjectMatrix, const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd, diff --git a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx index f54028d134..e29bfb674d 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx @@ -53,6 +53,11 @@ namespace drawinglayer SdrObjectWeakRef mpSdrOle2Obj; basegfx::B2DHomMatrix maObjectTransform; + // #i104867# The GraphicVersion number to identify in operator== if + // the graphic has changed, but without fetching it (which may + // be expensive, e.g. triggering chart creation) + sal_uInt32 mnGraphicVersion; + // bitfield unsigned mbHighContrast : 1; @@ -64,6 +69,7 @@ namespace drawinglayer SdrOleContentPrimitive2D( const SdrOle2Obj& rSdrOle2Obj, const basegfx::B2DHomMatrix& rObjectTransform, + sal_uInt32 nGraphicVersion, bool bHighContrast); // compare operator @@ -74,6 +80,7 @@ namespace drawinglayer // data access const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; } + sal_uInt32 getGraphicVersion() const { return mnGraphicVersion; } bool getHighContrast() const { return mbHighContrast; } // provide unique ID diff --git a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx index c604b4e1e9..20dede7f44 100644 --- a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx +++ b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx @@ -55,9 +55,8 @@ namespace drawinglayer double mfCornerRadiusY; // [0.0..1.0] relative to 1/2 height // bitfield - // flag which decides if this is a text frame. If Yes, the HitArea - // should be the filled geometry - bool mbTextFrame : 1; + // flag which decides if the HitArea should be the filled geometry + bool mbForceFillForHitTest : 1; protected: // local decomposition. @@ -69,7 +68,7 @@ namespace drawinglayer const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, double fCornerRadiusX, double fCornerRadiusY, - bool bTextFrame); + bool bForceFillForHitTest); // data access const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } @@ -77,7 +76,7 @@ namespace drawinglayer double getCornerRadiusX() const { return mfCornerRadiusX; } double getCornerRadiusY() const { return mfCornerRadiusY; } bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); } - bool getTextFrame() const { return mbTextFrame; } + bool getForceFillForHitTest() const { return mbForceFillForHitTest; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; diff --git a/svx/inc/svx/svddrgmt.hxx b/svx/inc/svx/svddrgmt.hxx index f1890c3bc7..96fb97c7e6 100644 --- a/svx/inc/svx/svddrgmt.hxx +++ b/svx/inc/svx/svddrgmt.hxx @@ -107,6 +107,22 @@ public: ////////////////////////////////////////////////////////////////////////////// +class SdrDragEntryPrimitive2DSequence : public SdrDragEntry +{ +private: + drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence; + +public: + SdrDragEntryPrimitive2DSequence( + const drawinglayer::primitive2d::Primitive2DSequence& rSequence, + bool bAddToTransparent); + virtual ~SdrDragEntryPrimitive2DSequence(); + + virtual drawinglayer::primitive2d::Primitive2DSequence createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod); +}; + +////////////////////////////////////////////////////////////////////////////// + class SdrDragEntryPointGlueDrag : public SdrDragEntry { private: @@ -138,6 +154,7 @@ protected: void clearSdrDragEntries() { for(sal_uInt32 a(0); a < maSdrDragEntries.size(); a++) { delete maSdrDragEntries[a]; } maSdrDragEntries.clear(); } void addSdrDragEntry(SdrDragEntry* pNew) { if(pNew) { maSdrDragEntries.push_back(pNew); }} virtual void createSdrDragEntries(); + virtual void createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool bModify); // access for derivated classes to maOverlayObjectList void clearOverlayObjectList() { maOverlayObjectList.clear(); } @@ -236,6 +253,9 @@ private: void ImpCheckSnap(const Point& rPt); +protected: + virtual void createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool bModify); + public: TYPEINFO(); SdrDragMove(SdrDragView& rNewView); diff --git a/svx/inc/svx/svdfppt.hxx b/svx/inc/svx/svdfppt.hxx index dba9f72cf6..048fb5dba8 100644 --- a/svx/inc/svx/svdfppt.hxx +++ b/svx/inc/svx/svdfppt.hxx @@ -610,7 +610,7 @@ public: UINT32& nMappedFontId, Font& rFont, char nDefault ) const; const PptDocumentAtom& GetDocumentAtom() const { return aDocAtom; } virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const; - SdrObject* CreateTable( SdrObject* pGroupObject, sal_uInt32* pTableArry, SvxMSDffSolverContainer* ) const; + SdrObject* CreateTable( SdrObject* pGroupObject, sal_uInt32* pTableArry, SvxMSDffSolverContainer* ); }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx index 1238cea024..6ce8f54039 100644 --- a/svx/inc/svx/svdoashp.hxx +++ b/svx/inc/svx/svdoashp.hxx @@ -179,6 +179,8 @@ public: virtual UINT16 GetObjIdentifier() const; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; + virtual void SetModel(SdrModel* pNewModel);
+ virtual void RecalcSnapRect(); virtual const Rectangle& GetSnapRect() const; diff --git a/svx/prj/build.lst b/svx/prj/build.lst index 56980702fb..2f595a2de9 100644 --- a/svx/prj/build.lst +++ b/svx/prj/build.lst @@ -22,7 +22,7 @@ sx svx\source\svdraw nmake - all sx_draw sx_inc NULL sx svx\source\sdr\attribute nmake - all sx_attribute sx_inc NULL sx svx\source\sdr\primitive2d nmake - all sx_primitive2d sx_inc NULL sx svx\source\sdr\primitive3d nmake - all sx_primitive3d sx_inc NULL -sx svx\source\table nmake - all sx_table NULL +sx svx\source\table nmake - all sx_table sx_inc NULL sx svx\source\sdr\properties nmake - all sx_properties sx_inc NULL sx svx\source\sdr\contact nmake - all sx_contact sx_inc NULL sx svx\source\sdr\event nmake - all sx_event sx_inc NULL diff --git a/svx/source/cui/SpellDialog.cxx b/svx/source/cui/SpellDialog.cxx index bead9b97bf..65e3c90e14 100644 --- a/svx/source/cui/SpellDialog.cxx +++ b/svx/source/cui/SpellDialog.cxx @@ -914,7 +914,7 @@ void SpellDialog::SetTitle_Impl(LanguageType nLang) const SpellErrorDescription* pSpellErrorDescription = aSentenceED.GetAlternatives(); if( pSpellErrorDescription && pSpellErrorDescription->sServiceName.getLength() ) { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); ::rtl::OUString sSuggestionImageUrl = SvtLinguConfig().GetSpellAndGrammarDialogImage( pSpellErrorDescription->sServiceName, bHighContrast ); aVendorImageFI.SetImage( lcl_GetImageFromPngUrl( sSuggestionImageUrl ) ); @@ -924,7 +924,7 @@ void SpellDialog::SetTitle_Impl(LanguageType nLang) } else { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); aVendorImageFI.SetImage( bHighContrast ? aVendorImageHC : aVendorImage ); } @@ -935,7 +935,7 @@ void SpellDialog::SetTitle_Impl(LanguageType nLang) } else { - //bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + //bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); sTitle = m_sTitleSpellingGrammar; } } diff --git a/svx/source/cui/align.cxx b/svx/source/cui/align.cxx index 77538a9a66..8e84817027 100644 --- a/svx/source/cui/align.cxx +++ b/svx/source/cui/align.cxx @@ -248,7 +248,7 @@ void AlignmentTabPage::InitVsRefEgde() // remember selection - is deleted in call to ValueSet::Clear() USHORT nSel = maVsRefEdge.GetSelectItemId(); - ResId aResId( GetBackground().GetColor().IsDark() ? IL_LOCK_BMPS_HC : IL_LOCK_BMPS, DIALOG_MGR() ); + ResId aResId( GetSettings().GetStyleSettings().GetHighContrastMode() ? IL_LOCK_BMPS_HC : IL_LOCK_BMPS, DIALOG_MGR() ); ImageList aImageList( aResId ); Size aItemSize( aImageList.GetImage( IID_BOTTOMLOCK ).GetSizePixel() ); diff --git a/svx/source/cui/border.cxx b/svx/source/cui/border.cxx index 1ab5a45b9e..5cda542e71 100644 --- a/svx/source/cui/border.cxx +++ b/svx/source/cui/border.cxx @@ -1033,8 +1033,8 @@ USHORT SvxBorderTabPage::GetPresetStringId( USHORT nValueSetIdx ) const void SvxBorderTabPage::FillPresetVS() { // find correct image list - bool bDark = aWndPresets.GetDisplayBackground().GetColor().IsDark(); - ImageList& rImgList = bDark ? aBorderImgLstH : aBorderImgLst; + bool bHC = aWndPresets.GetSettings().GetStyleSettings().GetHighContrastMode(); + ImageList& rImgList = bHC ? aBorderImgLstH : aBorderImgLst; Size aImgSize( rImgList.GetImage( IID_PRE_CELL_NONE ).GetSizePixel() ); // basic initialization of the ValueSet @@ -1060,8 +1060,8 @@ void SvxBorderTabPage::FillPresetVS() void SvxBorderTabPage::FillShadowVS() { // find correct image list - bool bDark = aWndShadows.GetDisplayBackground().GetColor().IsDark(); - ImageList& rImgList = bDark ? aShadowImgLstH : aShadowImgLst; + bool bHC = aWndPresets.GetSettings().GetStyleSettings().GetHighContrastMode(); + ImageList& rImgList = bHC ? aShadowImgLstH : aShadowImgLst; Size aImgSize( rImgList.GetImage( IID_SHADOWNONE ).GetSizePixel() ); // basic initialization of the ValueSet diff --git a/svx/source/cui/cfg.cxx b/svx/source/cui/cfg.cxx index 2931be6c17..d172735208 100644 --- a/svx/source/cui/cfg.cxx +++ b/svx/source/cui/cfg.cxx @@ -403,7 +403,7 @@ void InitImageType() Window* topwin = Application::GetActiveTopWindow(); if ( topwin != NULL && - topwin->GetDisplayBackground().GetColor().IsDark() ) + topwin->GetSettings().GetStyleSettings().GetHighContrastMode() ) { theImageType |= css::ui::ImageType::COLOR_HIGHCONTRAST; } @@ -5114,7 +5114,7 @@ SvxToolbarEntriesListBox::SvxToolbarEntriesListBox( BuildCheckBoxButtonImages( m_pButtonData ); EnableCheckButton( m_pButtonData ); - m_bHiContrastMode = GetDisplayBackground().GetColor().IsDark(); + m_bHiContrastMode = GetSettings().GetStyleSettings().GetHighContrastMode(); } // -------------------------------------------------------- @@ -5189,11 +5189,8 @@ void SvxToolbarEntriesListBox::DataChanged( const DataChangedEvent& rDCEvt ) if (( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE )) { - if ( m_bHiContrastMode != GetDisplayBackground().GetColor().IsDark() ) - { - // We have to reset all images because we change to/from high contrast mode - m_bHiContrastMode = GetDisplayBackground().GetColor().IsDark(); - } + // We have to reset all images because we change to/from high contrast mode + m_bHiContrastMode = GetSettings().GetStyleSettings().GetHighContrastMode(); BuildCheckBoxButtonImages( m_pButtonData ); Invalidate(); diff --git a/svx/source/cui/labdlg.cxx b/svx/source/cui/labdlg.cxx index bbcbe9c408..1c7cebefe9 100644 --- a/svx/source/cui/labdlg.cxx +++ b/svx/source/cui/labdlg.cxx @@ -574,7 +574,7 @@ void SvxCaptionTabPage::DataChanged( const DataChangedEvent& rDCEvt ) void SvxCaptionTabPage::FillValueSet() { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); Image** ppBitmaps = bHighContrast ? mpBmpCapTypesH : mpBmpCapTypes; aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_1, *(ppBitmaps[0]) ); diff --git a/svx/source/cui/macropg.cxx b/svx/source/cui/macropg.cxx index f705df676b..e5cd28b20f 100644 --- a/svx/source/cui/macropg.cxx +++ b/svx/source/cui/macropg.cxx @@ -494,9 +494,7 @@ void IconLBoxString::Paint( const Point& aPos, SvLBox& aDevice, sal_Int32 nIndex = aURL.indexOf( aVndSunStarUNO ); bool bUNO = nIndex == 0; - Wallpaper aBackground = aDevice.GetBackground(); - Color aColor = aBackground.GetColor(); - BOOL bHC = aColor.IsDark(); + BOOL bHC = aDevice.GetSettings().GetStyleSettings().GetHighContrastMode(); const Image* pImg; if( bHC ) pImg = bUNO ? m_pComponentImg_h : m_pMacroImg_h; diff --git a/svx/source/cui/numpages.cxx b/svx/source/cui/numpages.cxx index a9ba8c61cb..ce2ae1563f 100644 --- a/svx/source/cui/numpages.cxx +++ b/svx/source/cui/numpages.cxx @@ -378,18 +378,12 @@ int SvxSingleNumPickTabPage::DeactivatePage(SfxItemSet *_pSet) void SvxSingleNumPickTabPage::Reset( const SfxItemSet& rSet ) { - const SfxPoolItem* pItem; -// nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel(); - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); + nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; + + const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); + pSaveNum = new SvxNumRule(*rItem.GetNumRule()); if(!pActNum) pActNum = new SvxNumRule(*pSaveNum); @@ -570,17 +564,12 @@ int SvxBulletPickTabPage::DeactivatePage(SfxItemSet *_pSet) void SvxBulletPickTabPage::Reset( const SfxItemSet& rSet ) { - const SfxPoolItem* pItem; - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); + nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; + + const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); + pSaveNum = new SvxNumRule(*rItem.GetNumRule()); // nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel(); @@ -800,17 +789,12 @@ int SvxNumPickTabPage::DeactivatePage(SfxItemSet *_pSet) void SvxNumPickTabPage::Reset( const SfxItemSet& rSet ) { - const SfxPoolItem* pItem; - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); + nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; + + const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); + pSaveNum = new SvxNumRule(*rItem.GetNumRule()); // nActNumLvl = ((SwNumBulletTabDialog*)GetTabDialog())->GetActNumLevel(); if(!pActNum) @@ -1105,17 +1089,12 @@ BOOL SvxBitmapPickTabPage::FillItemSet( SfxItemSet& rSet ) void SvxBitmapPickTabPage::Reset( const SfxItemSet& rSet ) { - const SfxPoolItem* pItem; - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); + nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; + + const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); + pSaveNum = new SvxNumRule(*rItem.GetNumRule()); if(!pActNum) pActNum = new SvxNumRule(*pSaveNum); @@ -1537,17 +1516,12 @@ BOOL SvxNumOptionsTabPage::FillItemSet( SfxItemSet& rSet ) --------------------------------------------------*/ void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet ) { - const SfxPoolItem* pItem; - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); + nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; + + const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); + pSaveNum = new SvxNumRule(*rItem.GetNumRule()); // Ebenen einfuegen if(!aLevelLB.GetEntryCount()) @@ -1591,6 +1565,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet ) pPreviewWIN->SetNumRule(pActNum); aSameLevelCB.Check(pActNum->IsContinuousNumbering()); + const SfxPoolItem* pItem = 0; //ColorListBox bei Bedarf fuellen if ( pActNum->IsFeatureSupported( NUM_BULLET_COLOR ) ) { @@ -3434,17 +3409,12 @@ BOOL SvxNumPositionTabPage::FillItemSet( SfxItemSet& rSet ) --------------------------------------------------*/ void SvxNumPositionTabPage::Reset( const SfxItemSet& rSet ) { - const SfxPoolItem* pItem; - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, FALSE, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, FALSE, &pItem); - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); + nNumItemId = rSet.GetPool() ? rSet.GetPool()->GetWhich( SID_ATTR_NUMBERING_RULE ) : SID_ATTR_NUMBERING_RULE; + + const SvxNumBulletItem& rItem = static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, TRUE ) ); + delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); + pSaveNum = new SvxNumRule(*rItem.GetNumRule()); // Ebenen einfuegen if(!aLevelLB.GetEntryCount()) diff --git a/svx/source/cui/optaccessibility.cxx b/svx/source/cui/optaccessibility.cxx index 960cd5e46c..d815959bbf 100644 --- a/svx/source/cui/optaccessibility.cxx +++ b/svx/source/cui/optaccessibility.cxx @@ -151,8 +151,8 @@ BOOL SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet& ) aMiscSettings.SetEnableATToolSupport( m_aAccessibilityTool.IsChecked() ); #endif aAllSettings.SetMiscSettings(aMiscSettings); - Application::SetSettings(aAllSettings); Application::MergeSystemSettings( aAllSettings ); + Application::SetSettings(aAllSettings); return FALSE; } diff --git a/svx/source/cui/optcolor.cxx b/svx/source/cui/optcolor.cxx index 887be321ab..669a4e7f59 100644 --- a/svx/source/cui/optcolor.cxx +++ b/svx/source/cui/optcolor.cxx @@ -762,9 +762,9 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rRe Wallpaper aTransparentWall(TempColor); sal_Int32 nWinWidth = GetSizePixel().Width(); sal_Int32 nFTHeight = aChapters[0]->GetSizePixel().Height(); - sal_Bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); Color aBackColor; const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + sal_Bool bHighContrast = rStyleSettings.GetHighContrastMode(); if ( bHighContrast ) aBackColor = rStyleSettings.GetShadowColor(); else diff --git a/svx/source/cui/optimprove2.cxx b/svx/source/cui/optimprove2.cxx index 28989080ca..b988c7b75b 100644 --- a/svx/source/cui/optimprove2.cxx +++ b/svx/source/cui/optimprove2.cxx @@ -149,7 +149,13 @@ IMPL_LINK( SvxImprovementOptionsPage, HandleShowData, PushButton*, EMPTYARG ) { ::rtl::OUString sLogFile( m_sLogPath ); sLogFile += C2S("/Current.csv"); - uno::Sequence< beans::PropertyValue > aArgs; + uno::Sequence< beans::PropertyValue > aArgs(3); + aArgs[0].Name = ::rtl::OUString::createFromAscii("FilterName"); + aArgs[0].Value = uno::makeAny(::rtl::OUString::createFromAscii("Text - txt - csv (StarCalc)")); + aArgs[1].Name = ::rtl::OUString::createFromAscii("FilterOptions"); + aArgs[1].Value = uno::makeAny(::rtl::OUString::createFromAscii("44,34,12,1,")); + aArgs[2].Name = ::rtl::OUString::createFromAscii("ReadOnly"); + aArgs[2].Value = uno::makeAny(true); uno::Reference< lang::XComponent > xDoc = ::comphelper::SynchronousDispatch::dispatch( xDesktop, sLogFile, C2S("_default"), 0, aArgs ); diff --git a/svx/source/cui/optsave.cxx b/svx/source/cui/optsave.cxx index 18385e584b..e076c66e1d 100644 --- a/svx/source/cui/optsave.cxx +++ b/svx/source/cui/optsave.cxx @@ -233,7 +233,7 @@ SfxSaveTabPage::SfxSaveTabPage( Window* pParent, const SfxItemSet& rCoreSet ) : pImpl ( new SvxSaveTabPage_Impl ) { - sal_Bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + sal_Bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); aODFWarningFI.SetImage( Image( SVX_RES( bHighContrast ? IMG_ODF_WARNING_HC : IMG_ODF_WARNING ) ) ); diff --git a/svx/source/cui/readonlyimage.cxx b/svx/source/cui/readonlyimage.cxx index 77e842cac7..dd273ce511 100644 --- a/svx/source/cui/readonlyimage.cxx +++ b/svx/source/cui/readonlyimage.cxx @@ -46,7 +46,7 @@ ReadOnlyImage::ReadOnlyImage(Window* pParent, const ResId rResId) : FixedImage(pParent, rResId) { - sal_Bool bHighContrast = pParent->GetDisplayBackground().GetColor().IsDark(); + sal_Bool bHighContrast = pParent->GetSettings().GetStyleSettings().GetHighContrastMode(); SetImage( Image(SVX_RES(bHighContrast ? RID_SVXBMP_LOCK_HC : RID_SVXBMP_LOCK ))); } diff --git a/svx/source/cui/tphatch.cxx b/svx/source/cui/tphatch.cxx index 42f576836b..b17345aee9 100644 --- a/svx/source/cui/tphatch.cxx +++ b/svx/source/cui/tphatch.cxx @@ -164,7 +164,7 @@ SvxHatchTabPage::SvxHatchTabPage aBtnLoad.SetClickHdl( LINK( this, SvxHatchTabPage, ClickLoadHdl_Impl ) ); aBtnSave.SetClickHdl( LINK( this, SvxHatchTabPage, ClickSaveHdl_Impl ) ); - aCtlPreview.SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); } // ----------------------------------------------------------------------- @@ -905,7 +905,7 @@ void SvxHatchTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt ) void SvxHatchTabPage::DataChanged( const DataChangedEvent& rDCEvt ) { if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) ) - aCtlPreview.SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); SvxTabPage::DataChanged( rDCEvt ); } diff --git a/svx/source/cui/tpline.cxx b/svx/source/cui/tpline.cxx index 497d628fa3..36984b8f31 100644 --- a/svx/source/cui/tpline.cxx +++ b/svx/source/cui/tpline.cxx @@ -299,7 +299,7 @@ void SvxLineTabPage::Construct() void SvxLineTabPage::FillListboxes() { -// aCtlPreview.SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); +// aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); ResMgr& rMgr = DIALOG_MGR(); diff --git a/svx/source/cui/treeopt.cxx b/svx/source/cui/treeopt.cxx index 52d47523ed..01049d3c10 100644 --- a/svx/source/cui/treeopt.cxx +++ b/svx/source/cui/treeopt.cxx @@ -1078,7 +1078,7 @@ void OfaTreeOptionsDialog::DataChanged( const DataChangedEvent& rDCEvt ) !aTreeLB.GetParent(pEntry)) { OptionsGroupInfo* pInfo = static_cast<OptionsGroupInfo*>(pEntry->GetUserData()); - bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); ImageList* pImgLst = bHighContrast ? &aPageImagesHC : &aPageImages; for ( sal_uInt16 i = 0; i < aHelpTextsArr.Count(); ++i ) { @@ -1336,7 +1336,7 @@ IMPL_LINK( OfaTreeOptionsDialog, SelectHdl_Impl, Timer*, EMPTYARG ) OptionsGroupInfo* pTGInfo = (OptionsGroupInfo *)pEntry->GetUserData(); if ( pTGInfo->m_sPageURL.getLength() == 0 ) { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); ImageList* pImgLst = bHighContrast ? &aPageImagesHC : &aPageImages; //hier den Hilfetext anzeigen for ( sal_uInt16 i = 0; i < aHelpTextsArr.Count(); ++i ) diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 16f48581bc..04cdd9e041 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -696,7 +696,16 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) : ClearItem( SDRATTR_TEXTDIRECTION ); //SJ: vertical writing is not required, by removing this item no outliner is created - // For primitive rendering, shadow handling is done completely based on the geometry, so i removed it here + // #i105323# For 2D AtoShapes, the shadow attirbute does not need to be applied to any + // of the constucted helper SdrObjects. This would lead to problems since the shadow + // of one helper object would fall on one helper object behind it (e.g. with the + // eyes of the smiley shape). This is not wanted; instead a single shadow 'behind' + // the AutoShape visualisation is wanted. This is done with primitive functionailty + // now in SdrCustomShapePrimitive2D::create2DDecomposition, but only for 2D objects + // (see there and in EnhancedCustomShape3d::Create3DObject to read more). + // This exception may be removed later when AutoShapes will create primitives directly. + // So, currently remove the ShadowAttribute from the ItemSet to not apply it to any + // 2D helper shape. ClearItem(SDRATTR_SHADOW); Point aP( pCustomShapeObj->GetSnapRect().Center() ); @@ -731,23 +740,23 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) : /*const sal_Int32* pDefData =*/ ApplyShapeAttributes( rGeometryItem ); switch( eSpType ) { - case mso_sptCan : nColorData = 0x20400000; break;
- case mso_sptCube : nColorData = 0x302e0000; break;
- case mso_sptActionButtonBlank : nColorData = 0x502ce400; break;
- case mso_sptActionButtonHome : nColorData = 0x702ce4ce; break;
- case mso_sptActionButtonHelp : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonInformation : nColorData = 0x702ce4c5; break;
- case mso_sptActionButtonBackPrevious : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonForwardNext : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonBeginning : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonEnd : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonReturn : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonDocument : nColorData = 0x702ce4ec; break;
- case mso_sptActionButtonSound : nColorData = 0x602ce4c0; break;
- case mso_sptActionButtonMovie : nColorData = 0x602ce4c0; break;
- case mso_sptBevel : nColorData = 0x502ce400; break;
- case mso_sptFoldedCorner : nColorData = 0x20e00000; break;
- case mso_sptSmileyFace : nColorData = 0x20e00000; break;
+ case mso_sptCan : nColorData = 0x20400000; break; + case mso_sptCube : nColorData = 0x302e0000; break; + case mso_sptActionButtonBlank : nColorData = 0x502ce400; break; + case mso_sptActionButtonHome : nColorData = 0x702ce4ce; break; + case mso_sptActionButtonHelp : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonInformation : nColorData = 0x702ce4c5; break; + case mso_sptActionButtonBackPrevious : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonForwardNext : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonBeginning : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonEnd : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonReturn : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonDocument : nColorData = 0x702ce4ec; break; + case mso_sptActionButtonSound : nColorData = 0x602ce4c0; break; + case mso_sptActionButtonMovie : nColorData = 0x602ce4c0; break; + case mso_sptBevel : nColorData = 0x502ce400; break; + case mso_sptFoldedCorner : nColorData = 0x20e00000; break; + case mso_sptSmileyFace : nColorData = 0x20e00000; break; case mso_sptNil : { if( sShapeType.getLength() > 4 && @@ -1701,19 +1710,19 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm if(aNewB2DPolyPolygon.count()) { - if( !bLineGeometryNeededOnly )
- {
- // hack aNewB2DPolyPolygon to fill logic rect - this is
- // needed to produce gradient fills that look like mso
- aNewB2DPolygon.clear();
- aNewB2DPolygon.append(basegfx::B2DPoint(0,0));
- aNewB2DPolyPolygon.append(aNewB2DPolygon);
-
- aNewB2DPolygon.clear();
- aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(),
- aLogicRect.GetHeight()));
- aNewB2DPolyPolygon.append(aNewB2DPolygon);
- }
+ if( !bLineGeometryNeededOnly ) + { + // hack aNewB2DPolyPolygon to fill logic rect - this is + // needed to produce gradient fills that look like mso + aNewB2DPolygon.clear(); + aNewB2DPolygon.append(basegfx::B2DPoint(0,0)); + aNewB2DPolyPolygon.append(aNewB2DPolygon); + + aNewB2DPolygon.clear(); + aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(), + aLogicRect.GetHeight())); + aNewB2DPolyPolygon.append(aNewB2DPolygon); + } // #i37011# bool bForceCreateTwoObjects(false); diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index ed94bcf075..4fec059147 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -323,7 +323,17 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con Point aCenter( aSnapRect.Center() ); SfxItemSet aSet( pCustomShape->GetMergedItemSet() ); - aSet.ClearItem( SDRATTR_TEXTDIRECTION ); //SJ: vertical writing is not required, by removing this item no outliner is created + + //SJ: vertical writing is not required, by removing this item no outliner is created + aSet.ClearItem( SDRATTR_TEXTDIRECTION ); + + // #i105323# For 3D AutoShapes, the shadow attribute has to be applied to each + // created visualisation helper model shape individually. The shadow itself + // will then be rendered from the 3D renderer correctly for the whole 3D scene + // (and thus behind all objects of which the visualisation may be built). So, + // dio NOT remove it from the ItemSet here. + // aSet.ClearItem(SDRATTR_SHADOW); + std::vector< E3dCompoundObject* > aPlaceholderObjectList; double fExtrusionBackward, fExtrusionForward; diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 1b33ad47ac..581c12712c 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -1212,7 +1212,7 @@ void SvxBmpMask::DataChanged( const DataChangedEvent& rDCEvt ) void SvxBmpMask::ApplyStyle() { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); aTbxPipette.SetItemImage( TBI_PIPETTE, bHighContrast ? maImgPipetteH : maImgPipette ); } diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index a81eba3cb1..92c03de1d6 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -1133,7 +1133,7 @@ IMPL_LINK( SvxSuperContourDlg, WorkplaceClickHdl, ContourWindow*, pWnd ) void SvxSuperContourDlg::ApplyImageList() { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); ImageList& rImgLst = bHighContrast ? maImageListH : maImageList; diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index 2005cfb043..ad96fab911 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -374,7 +374,7 @@ void SvxXConnectionPreview::MouseButtonDown( const MouseEvent& rMEvt ) void SvxXConnectionPreview::SetStyles() { const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings(); - SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); SetBackground( Wallpaper( Color( rStyles.GetFieldColor() ) ) ); } diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 2d3b9d33b4..a0d401eb4f 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1202,7 +1202,7 @@ void HatchingLB::UserDraw( const UserDrawEvent& rUDEvt ) OutputDevice* pDevice = rUDEvt.GetDevice(); ULONG nOldDrawMode = pDevice->GetDrawMode(); - pDevice->SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + pDevice->SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); XHatch& rXHatch = mpList->GetHatch( rUDEvt.GetItemId() )->GetHatch(); MapMode aMode( MAP_100TH_MM ); @@ -1943,7 +1943,7 @@ SvxPreviewBase::SvxPreviewBase( Window* pParent, const ResId& rResId ) { // Draw the control's border as a flat thin black line. SetBorderStyle(WINDOW_BORDER_MONO); - SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); SetMapMode(MAP_100TH_MM); // init model @@ -2006,7 +2006,7 @@ void SvxPreviewBase::StateChanged(StateChangedType nType) void SvxPreviewBase::DataChanged(const DataChangedEvent& rDCEvt) { - SetDrawMode(GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR); + SetDrawMode(GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR); if((DATACHANGED_SETTINGS == rDCEvt.GetType()) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) { diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index cd828cfaa8..ea7ff7479a 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -917,9 +917,7 @@ void RecovDocListEntry::Paint(const Point& aPos , const String* pTxt = 0; RecovDocList* pList = static_cast< RecovDocList* >(&aDevice); - Wallpaper aBackground = aDevice.GetBackground(); - Color aColor = aBackground.GetColor(); - BOOL bHC = aColor.IsDark(); + BOOL bHC = aDevice.GetSettings().GetStyleSettings().GetHighContrastMode(); TURLInfo* pInfo = (TURLInfo*)pEntry->GetUserData(); switch(pInfo->RecoveryState) diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index c361d97426..b967f3ed79 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -1228,9 +1228,7 @@ void SvxFontWorkDialog::DataChanged( const DataChangedEvent& rDCEvt ) ---------------------------------------------------------------------------*/ void SvxFontWorkDialog::ApplyImageList() { - bool bHighContrast = - (GetSettings().GetStyleSettings().GetHighContrastMode() != 0) && - (GetDisplayBackground().GetColor().IsDark() != 0); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); ResMgr* _pMgr = &DIALOG_MGR(); diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index 88bbbb8ef2..1347062895 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -328,7 +328,7 @@ void FrameSelectorImpl::InitColors() { const StyleSettings& rSett = mrFrameSel.GetSettings().GetStyleSettings(); maBackCol = rSett.GetFieldColor(); - mbHCMode = maBackCol.IsDark(); + mbHCMode = rSett.GetHighContrastMode(); maArrowCol = rSett.GetFieldTextColor(); maMarkCol.operator=( maBackCol ).Merge( maArrowCol, mbHCMode ? 0x80 : 0xC0 ); maHCLineCol = rSett.GetLabelTextColor(); diff --git a/svx/source/dialog/hyprlink.cxx b/svx/source/dialog/hyprlink.cxx index ee7c272fcc..c1be60ebe3 100644 --- a/svx/source/dialog/hyprlink.cxx +++ b/svx/source/dialog/hyprlink.cxx @@ -828,10 +828,7 @@ void SvxHyperlinkDlg::DataChanged( const DataChangedEvent& rDCEvt ) void SvxHyperlinkDlg::SetImages() { - bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode() != 0; - - if( bHighContrast ) - bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); SetItemImage( BTN_LINK, mpManager->GetImage( BTN_LINK, bHighContrast ) ); SetItemImage( BTN_INSERT_BOOKMARK, mpManager->GetImage( BTN_INSERT_BOOKMARK, bHighContrast ) ); diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 9cf1e4cb46..23dbaa60ea 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -1042,7 +1042,7 @@ IMPL_LINK( SvxIMapDlg, MiscHdl, void*, EMPTYARG ) void SvxIMapDlg::ApplyImageList() { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); ImageList& rImgLst = bHighContrast ? maImageListH : maImageList; diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index b70f498c60..499f96d6a4 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -181,7 +181,7 @@ USHORT SvxLanguageBox::ImplInsertImgEntry( const String& rEntry, USHORT nPos, bo USHORT nRet = 0; if( !bChecked ) nRet = InsertEntry( rEntry, m_aNotCheckedImage, nPos ); - else if( GetSettings().GetStyleSettings().GetFaceColor().IsDark() ) + else if( GetSettings().GetStyleSettings().GetHighContrastMode() ) nRet = InsertEntry( rEntry, m_aCheckedImageHC, nPos ); else nRet = InsertEntry( rEntry, m_aCheckedImage, nPos ); diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx index c7a4786a0f..3311375461 100644 --- a/svx/source/dialog/measctrl.cxx +++ b/svx/source/dialog/measctrl.cxx @@ -79,7 +79,7 @@ SvxXMeasurePreview::SvxXMeasurePreview //pMeasureObj->SetItemSetAndBroadcast(rInAttrs); pMeasureObj->SetMergedItemSetAndBroadcast(rInAttrs); - SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); Invalidate(); } @@ -196,7 +196,7 @@ void SvxXMeasurePreview::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); } } diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index fc72b665ad..5bdfa05a3f 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -76,7 +76,7 @@ void SvxSwFrameExample::InitColors_Impl( void ) const StyleSettings& rSettings = GetSettings().GetStyleSettings(); m_aBgCol = Color( rSettings.GetWindowColor() ); // old: COL_WHITE - BOOL bHC = m_aBgCol.IsDark(); + BOOL bHC = rSettings.GetHighContrastMode(); m_aFrameColor = Color( COL_LIGHTGREEN ); m_aAlignColor = Color( COL_LIGHTRED ); diff --git a/svx/source/engine3d/helperhittest3d.cxx b/svx/source/engine3d/helperhittest3d.cxx index 401111be85..270e725024 100644 --- a/svx/source/engine3d/helperhittest3d.cxx +++ b/svx/source/engine3d/helperhittest3d.cxx @@ -36,18 +36,10 @@ #include <svx/svdpage.hxx> #include <svx/scene3d.hxx> #include <svditer.hxx> -#include <drawinglayer/processor3d/baseprocessor3d.hxx> -#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx> -#include <drawinglayer/primitive3d/transformprimitive3d.hxx> -#include <drawinglayer/primitive3d/polygonprimitive3d.hxx> -#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx> +#include <drawinglayer/processor3d/cutfindprocessor3d.hxx> #include <svx/sdr/contact/viewcontactofe3d.hxx> #include <svx/sdr/contact/viewcontactofe3dscene.hxx> -#include <basegfx/polygon/b3dpolygontools.hxx> -#include <basegfx/polygon/b3dpolypolygontools.hxx> -#include <drawinglayer/primitive3d/hittestprimitive3d.hxx> #include <com/sun/star/uno/Sequence.h> -#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -80,176 +72,13 @@ public: ////////////////////////////////////////////////////////////////////////////// -namespace drawinglayer -{ - namespace processor3d - { - class CutFindProcessor : public BaseProcessor3D - { - private: - // the start and stop point for the cut vector - basegfx::B3DPoint maFront; - basegfx::B3DPoint maBack; - - // the found cut points - ::std::vector< basegfx::B3DPoint > maResult; - - // #i102956# the transformation change from TransformPrimitive3D processings - // needs to be remembered to be able to transform found cuts to the - // basic coordinate system the processor starts with - basegfx::B3DHomMatrix maCombinedTransform; - - // as tooling, the process() implementation takes over API handling and calls this - // virtual render method when the primitive implementation is BasePrimitive3D-based. - virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate); - - public: - CutFindProcessor(const geometry::ViewInformation3D& rViewInformation, - const basegfx::B3DPoint& rFront, - const basegfx::B3DPoint& rBack) - : BaseProcessor3D(rViewInformation), - maFront(rFront), - maBack(rBack), - maResult(), - maCombinedTransform() - {} - - // data access - const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; } - }; - - void CutFindProcessor::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate) - { - // it is a BasePrimitive3D implementation, use getPrimitiveID() call for switch - switch(rCandidate.getPrimitiveID()) - { - case PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D : - { - // transform group. - const primitive3d::TransformPrimitive3D& rPrimitive = static_cast< const primitive3d::TransformPrimitive3D& >(rCandidate); - - // remember old and transform front, back to object coordinates - const basegfx::B3DPoint aLastFront(maFront); - const basegfx::B3DPoint aLastBack(maBack); - basegfx::B3DHomMatrix aInverseTrans(rPrimitive.getTransformation()); - aInverseTrans.invert(); - maFront *= aInverseTrans; - maBack *= aInverseTrans; - - // remember current and create new transformation; add new object transform from right side - const geometry::ViewInformation3D aLastViewInformation3D(getViewInformation3D()); - const geometry::ViewInformation3D aNewViewInformation3D( - aLastViewInformation3D.getObjectTransformation() * rPrimitive.getTransformation(), - aLastViewInformation3D.getOrientation(), - aLastViewInformation3D.getProjection(), - aLastViewInformation3D.getDeviceToView(), - aLastViewInformation3D.getViewTime(), - aLastViewInformation3D.getExtendedInformationSequence()); - updateViewInformation(aNewViewInformation3D); - - // #i102956# remember needed back-transform for found cuts (combine from right side) - const basegfx::B3DHomMatrix aLastCombinedTransform(maCombinedTransform); - maCombinedTransform = maCombinedTransform * rPrimitive.getTransformation(); - - // let break down - process(rPrimitive.getChildren()); - - // restore transformations and front, back - maCombinedTransform = aLastCombinedTransform; - updateViewInformation(aLastViewInformation3D); - maFront = aLastFront; - maBack = aLastBack; - break; - } - case PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D : - { - // PolygonHairlinePrimitive3D, not used for hit test with planes, ignore. This - // means that also thick line expansion will not be hit-tested as - // PolyPolygonMaterialPrimitive3D - break; - } - case PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D : - { - // #i97321# - // For HatchTexturePrimitive3D, do not use the decomposition since it will produce - // clipped hatch lines in 3D. It can be used when the hatch also has a filling, but for - // simplicity, just use the children which are the PolyPolygonMaterialPrimitive3D - // which define the hatched areas anyways; for HitTest this is more than adequate - const primitive3d::HatchTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::HatchTexturePrimitive3D& >(rCandidate); - process(rPrimitive.getChildren()); - break; - } - case PRIMITIVE3D_ID_HITTESTPRIMITIVE3D : - { - // HitTestPrimitive3D, force usage due to we are doing a hit test and this - // primitive only gets generated on 3d objects without fill, exactly for this - // purpose - const primitive3d::HitTestPrimitive3D& rPrimitive = static_cast< const primitive3d::HitTestPrimitive3D& >(rCandidate); - process(rPrimitive.getChildren()); - break; - } - case PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D : - { - // PolyPolygonMaterialPrimitive3D - const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const primitive3d::PolyPolygonMaterialPrimitive3D& >(rCandidate); - - if(!maFront.equal(maBack)) - { - const basegfx::B3DPolyPolygon& rPolyPolygon = rPrimitive.getB3DPolyPolygon(); - const sal_uInt32 nPolyCount(rPolyPolygon.count()); - - if(nPolyCount) - { - const basegfx::B3DPolygon aPolygon(rPolyPolygon.getB3DPolygon(0)); - const sal_uInt32 nPointCount(aPolygon.count()); - - if(nPointCount > 2) - { - const basegfx::B3DVector aPlaneNormal(aPolygon.getNormal()); - - if(!aPlaneNormal.equalZero()) - { - const basegfx::B3DPoint aPointOnPlane(aPolygon.getB3DPoint(0)); - double fCut(0.0); - - if(basegfx::tools::getCutBetweenLineAndPlane(aPlaneNormal, aPointOnPlane, maFront, maBack, fCut)) - { - const basegfx::B3DPoint aCutPoint(basegfx::interpolate(maFront, maBack, fCut)); - - if(basegfx::tools::isInside(rPolyPolygon, aCutPoint, false)) - { - // #i102956# add result. Do not forget to do this in the coordinate - // system the processor get started with, so use the collected - // combined transformation from processed TransformPrimitive3D's - maResult.push_back(maCombinedTransform * aCutPoint); - } - } - } - } - } - } - - break; - } - default : - { - // process recursively - process(rCandidate.get3DDecomposition(getViewInformation3D())); - break; - } - } - } - } // end of namespace processor3d -} // end of namespace drawinglayer - -////////////////////////////////////////////////////////////////////////////// - void getAllHit3DObjectWithRelativePoint( const basegfx::B3DPoint& rFront, const basegfx::B3DPoint& rBack, const E3dCompoundObject& rObject, const drawinglayer::geometry::ViewInformation3D& rObjectViewInformation3D, - ::std::vector< basegfx::B3DPoint >& o_rResult) + ::std::vector< basegfx::B3DPoint >& o_rResult, + bool bAnyHit) { o_rResult.clear(); @@ -271,7 +100,7 @@ void getAllHit3DObjectWithRelativePoint( if(aObjectRange.overlaps(aFrontBackRange)) { // bound volumes hit, geometric cut tests needed - drawinglayer::processor3d::CutFindProcessor aCutFindProcessor(rObjectViewInformation3D, rFront, rBack); + drawinglayer::processor3d::CutFindProcessor aCutFindProcessor(rObjectViewInformation3D, rFront, rBack, bAnyHit); aCutFindProcessor.process(aPrimitives); o_rResult = aCutFindProcessor.getCutPoints(); } @@ -388,7 +217,7 @@ SVX_DLLPUBLIC void getAllHit3DObjectsSortedFrontToBack( { // get all hit points with object ::std::vector< basegfx::B3DPoint > aHitsWithObject; - getAllHit3DObjectWithRelativePoint(aFront, aBack, *pCandidate, aViewInfo3D, aHitsWithObject); + getAllHit3DObjectWithRelativePoint(aFront, aBack, *pCandidate, aViewInfo3D, aHitsWithObject, false); for(sal_uInt32 a(0); a < aHitsWithObject.size(); a++) { @@ -452,7 +281,7 @@ bool checkHitSingle3DObject( { // get all hit points with object ::std::vector< basegfx::B3DPoint > aHitsWithObject; - getAllHit3DObjectWithRelativePoint(aFront, aBack, rCandidate, aViewInfo3D, aHitsWithObject); + getAllHit3DObjectWithRelativePoint(aFront, aBack, rCandidate, aViewInfo3D, aHitsWithObject, true); if(aHitsWithObject.size()) { diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index c5af260f72..c56b4b77f6 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -778,7 +778,7 @@ namespace svxform SvLBoxEntry* XFormsPage::AddEntry( ItemNode* _pNewNode, bool _bIsElement ) { SvLBoxEntry* pParent = m_aItemList.FirstSelected(); - const ImageList& rImageList = GetBackground().GetColor().IsDark() + const ImageList& rImageList = GetSettings().GetStyleSettings().GetHighContrastMode() ? m_pNaviWin->GetItemHCImageList() : m_pNaviWin->GetItemImageList(); USHORT nImageID = ( _bIsElement ) ? IID_ELEMENT : IID_ATTRIBUTE; @@ -988,7 +988,7 @@ namespace svxform SvLBoxEntry* XFormsPage::AddEntry( const Reference< XPropertySet >& _rEntry ) { SvLBoxEntry* pEntry = NULL; - const ImageList& rImageList = GetBackground().GetColor().IsDark() + const ImageList& rImageList = GetSettings().GetStyleSettings().GetHighContrastMode() ? m_pNaviWin->GetItemHCImageList() : m_pNaviWin->GetItemImageList(); Image aImage = rImageList.GetImage( IID_ELEMENT ); @@ -1244,7 +1244,7 @@ namespace svxform m_xUIHelper = Reference< css::xforms::XFormsUIHelper1 >( _xModel, UNO_QUERY ); String sRet; m_bHasModel = true; - const ImageList& rImageList = GetBackground().GetColor().IsDark() + const ImageList& rImageList = GetSettings().GetStyleSettings().GetHighContrastMode() ? m_pNaviWin->GetItemHCImageList() : m_pNaviWin->GetItemImageList(); diff --git a/svx/source/form/fmcontrollayout.cxx b/svx/source/form/fmcontrollayout.cxx index e807f13fcd..081540aa1b 100644 --- a/svx/source/form/fmcontrollayout.cxx +++ b/svx/source/form/fmcontrollayout.cxx @@ -30,17 +30,28 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" + #include "fmcontrollayout.hxx" -#ifndef _SVX_FMPROP_HRC #include "fmprop.hrc" -#endif /** === begin UNO includes === **/ #include <com/sun/star/form/FormComponentType.hpp> #include <com/sun/star/awt/VisualEffect.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> +#include <com/sun/star/lang/Locale.hpp> +#include <com/sun/star/awt/FontDescriptor.hpp> +#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XChild.hpp> /** === end UNO includes === **/ -#include <tools/debug.hxx> + #include <comphelper/processfactory.hxx> +#include <i18npool/mslangid.hxx> +#include <svtools/syslocale.hxx> +#include <toolkit/helper/vclunohelper.hxx> +#include <tools/debug.hxx> +#include <tools/diagnose_ex.h> +#include <vcl/outdev.hxx> //........................................................................ namespace svxform @@ -48,15 +59,171 @@ namespace svxform //........................................................................ using namespace ::utl; - using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::awt; - using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::form; + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::beans::XPropertySet; + using ::com::sun::star::beans::XPropertySetInfo; + using ::com::sun::star::lang::Locale; + using ::com::sun::star::awt::FontDescriptor; + using ::com::sun::star::style::XStyleFamiliesSupplier; + using ::com::sun::star::lang::XServiceInfo; + using ::com::sun::star::container::XNameAccess; + using ::com::sun::star::container::XChild; + /** === end UNO using === **/ + namespace FormComponentType = ::com::sun::star::form::FormComponentType; + namespace VisualEffect = ::com::sun::star::awt::VisualEffect; + namespace ScriptType = ::com::sun::star::i18n::ScriptType; + + //-------------------------------------------------------------------- + namespace + { + //.................................................................... + template< class INTERFACE_TYPE > + Reference< INTERFACE_TYPE > getTypedModelNode( const Reference< XInterface >& _rxModelNode ) + { + Reference< INTERFACE_TYPE > xTypedNode( _rxModelNode, UNO_QUERY ); + if ( xTypedNode.is() ) + return xTypedNode; + else + { + Reference< XChild > xChild( _rxModelNode, UNO_QUERY ); + if ( xChild.is() ) + return getTypedModelNode< INTERFACE_TYPE >( xChild->getParent() ); + else + return NULL; + } + } + + //.................................................................... + static bool lcl_getDocumentDefaultStyleAndFamily( const Reference< XInterface >& _rxDocument, ::rtl::OUString& _rFamilyName, ::rtl::OUString& _rStyleName ) SAL_THROW(( Exception )) + { + bool bSuccess = true; + Reference< XServiceInfo > xDocumentSI( _rxDocument, UNO_QUERY ); + if ( xDocumentSI.is() ) + { + if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) + || xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.WebDocument" ) ) ) + ) + { + _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphStyles" ) ); + _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ); + } + else if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ) ) ) ) + { + _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CellStyles" ) ); + _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Default" ) ); + } + else if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) ) ) + || xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) + ) + { + _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "graphics" ) ); + _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "standard" ) ); + } + else + bSuccess = false; + } + return bSuccess; + } + + //.................................................................... + static void lcl_initializeControlFont( const Reference< XPropertySet >& _rxModel ) + { + try + { + Reference< XPropertySet > xStyle( ControlLayouter::getDefaultDocumentTextStyle( _rxModel ), UNO_SET_THROW ); + Reference< XPropertySetInfo > xStylePSI( xStyle->getPropertySetInfo(), UNO_SET_THROW ); + + // determine the script type associated with the system locale + const LocaleDataWrapper& rSysLocaleData = SvtSysLocale().GetLocaleData(); + const sal_Int16 eSysLocaleScriptType = MsLangId::getScriptType( MsLangId::convertLocaleToLanguage( rSysLocaleData.getLocale() ) ); + + // depending on this script type, use the right property from the document's style which controls the + // default locale for document content + const sal_Char* pCharLocalePropertyName = "CharLocale"; + switch ( eSysLocaleScriptType ) + { + case ScriptType::LATIN: + // already defaulted above + break; + case ScriptType::ASIAN: + pCharLocalePropertyName = "CharLocaleAsian"; + break; + case ScriptType::COMPLEX: + pCharLocalePropertyName = "CharLocaleComplex"; + break; + default: + OSL_ENSURE( false, "lcl_initializeControlFont: unexpected script type for system locale!" ); + break; + } + + ::rtl::OUString sCharLocalePropertyName = ::rtl::OUString::createFromAscii( pCharLocalePropertyName ); + Locale aDocumentCharLocale; + if ( xStylePSI->hasPropertyByName( sCharLocalePropertyName ) ) + { + OSL_VERIFY( xStyle->getPropertyValue( sCharLocalePropertyName ) >>= aDocumentCharLocale ); + } + // fall back to CharLocale property at the style + if ( !aDocumentCharLocale.Language.getLength() ) + { + sCharLocalePropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharLocale" ) ); + if ( xStylePSI->hasPropertyByName( sCharLocalePropertyName ) ) + { + OSL_VERIFY( xStyle->getPropertyValue( sCharLocalePropertyName ) >>= aDocumentCharLocale ); + } + } + // fall back to the system locale + if ( !aDocumentCharLocale.Language.getLength() ) + { + aDocumentCharLocale = rSysLocaleData.getLocale(); + } + + // retrieve a default font for this locale, and set it at the control + Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_SANS, MsLangId::convertLocaleToLanguage( aDocumentCharLocale ), DEFAULTFONT_FLAGS_ONLYONE ); + FontDescriptor aFontDesc = VCLUnoHelper::CreateFontDescriptor( aFont ); + _rxModel->setPropertyValue( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FontDescriptor" ) ), + makeAny( aFontDesc ) + ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + } //==================================================================== //= ControlLayouter //==================================================================== //-------------------------------------------------------------------- + Reference< XPropertySet > ControlLayouter::getDefaultDocumentTextStyle( const Reference< XPropertySet >& _rxModel ) + { + // the style family collection + Reference< XStyleFamiliesSupplier > xSuppStyleFamilies( getTypedModelNode< XStyleFamiliesSupplier >( _rxModel.get() ), UNO_SET_THROW ); + Reference< XNameAccess > xStyleFamilies( xSuppStyleFamilies->getStyleFamilies(), UNO_SET_THROW ); + + // the names of the family, and the style - depends on the document type we live in + ::rtl::OUString sFamilyName, sStyleName; + if ( !lcl_getDocumentDefaultStyleAndFamily( xSuppStyleFamilies.get(), sFamilyName, sStyleName ) ) + throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "unknown document type!" ) ), NULL ); + + // the concrete style + Reference< XNameAccess > xStyleFamily( xStyleFamilies->getByName( sFamilyName ), UNO_QUERY_THROW ); + return Reference< XPropertySet >( xStyleFamily->getByName( sStyleName ), UNO_QUERY_THROW ); + } + + //-------------------------------------------------------------------- void ControlLayouter::initializeControlLayout( const Reference< XPropertySet >& _rxControlModel, DocumentType _eDocType ) { DBG_ASSERT( _rxControlModel.is(), "ControlLayouter::initializeControlLayout: invalid model!" ); @@ -65,10 +232,7 @@ namespace svxform try { - Reference< XPropertySetInfo > xPSI( _rxControlModel->getPropertySetInfo() ); - if ( !xPSI.is() ) - // can't do anything - return; + Reference< XPropertySetInfo > xPSI( _rxControlModel->getPropertySetInfo(), UNO_SET_THROW ); // the control type sal_Int16 nClassId = FormComponentType::CONTROL; @@ -114,6 +278,13 @@ namespace svxform if ( xPSI->hasPropertyByName( FM_PROP_VISUALEFFECT ) ) _rxControlModel->setPropertyValue( FM_PROP_VISUALEFFECT, makeAny( nVisualEffect ) ); } + + // the font (only if we use the document's ref devices for rendering control text, otherwise, the + // default font of VCL controls is assumed to be fine) + if ( useDocumentReferenceDevice( _eDocType ) + && xPSI->hasPropertyByName( FM_PROP_FONT ) + ) + lcl_initializeControlFont( _rxControlModel ); } catch( const Exception& ) { @@ -141,6 +312,18 @@ namespace svxform return bDynamicBorderColor; } + //-------------------------------------------------------------------- + bool ControlLayouter::useDocumentReferenceDevice( DocumentType _eDocType ) + { + if ( _eDocType == eUnknownDocumentType ) + return false; + OConfigurationNode aConfig = getLayoutSettings( _eDocType ); + Any aUseRefDevice = aConfig.getNodeValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseDocumentTextMetrics" ) ) ); + bool bUseRefDevice = false; + OSL_VERIFY( aUseRefDevice >>= bUseRefDevice ); + return bUseRefDevice; + } + //........................................................................ } // namespace svxform //........................................................................ diff --git a/svx/source/form/fmmodel.cxx b/svx/source/form/fmmodel.cxx index 73a1471b26..56ea8a2014 100644 --- a/svx/source/form/fmmodel.cxx +++ b/svx/source/form/fmmodel.cxx @@ -30,30 +30,27 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" + +#include "fmundo.hxx" +#include "fmdocumentclassification.hxx" +#include "fmcontrollayout.hxx" + +#include <svx/fmmodel.hxx> +#include <svx/fmpage.hxx> +#include <svx/svdobj.hxx> #include <tools/debug.hxx> #ifndef SVX_LIGHT -#ifndef _SFX_OBJSH_HXX //autogen #include <sfx2/objsh.hxx> -#endif #else class SfxObjectShell; #endif -#ifndef _FM_FMMODEL_HXX -#include <svx/fmmodel.hxx> -#endif - -#ifndef _FM_PAGE_HXX -#include <svx/fmpage.hxx> -#endif -#include "fmundo.hxx" -#ifndef _SVX_SVDOBJ_HXX -#include <svx/svdobj.hxx> -#endif +#include <boost/optional.hpp> using ::com::sun::star::uno::Reference; using ::com::sun::star::container::XNameContainer; +using namespace svxform; TYPEINIT1(FmFormModel, SdrModel); @@ -62,11 +59,14 @@ struct FmFormModelImplData FmXUndoEnvironment* pUndoEnv; sal_Bool bOpenInDesignIsDefaulted; sal_Bool bMovingPage; + ::boost::optional< sal_Bool > + aControlsUseRefDevice; FmFormModelImplData() :pUndoEnv( NULL ) ,bOpenInDesignIsDefaulted( sal_True ) ,bMovingPage( sal_False ) + ,aControlsUseRefDevice() { } }; @@ -314,6 +314,19 @@ sal_Bool FmFormModel::OpenInDesignModeIsDefaulted( ) #endif //------------------------------------------------------------------------ +sal_Bool FmFormModel::ControlsUseRefDevice() const +{ + if ( !m_pImpl->aControlsUseRefDevice ) + { + DocumentType eDocType = eUnknownDocumentType; + if ( m_pObjShell ) + eDocType = DocumentClassification::classifyHostDocument( m_pObjShell->GetModel() ); + m_pImpl->aControlsUseRefDevice.reset( ControlLayouter::useDocumentReferenceDevice( eDocType ) ); + } + return *m_pImpl->aControlsUseRefDevice; +} + +//------------------------------------------------------------------------ void FmFormModel::SetAutoControlFocus( sal_Bool _bAutoControlFocus ) { #ifndef SVX_LIGHT diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index 5a32ea8314..558f23b2a8 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -81,6 +81,10 @@ FmFormObj::FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType) ,m_pLastKnownRefDevice ( NULL ) { DBG_CTOR(FmFormObj, NULL); + + // normally, this is done in SetUnoControlModel, but if the call happened in the base class ctor, + // then our incarnation of it was not called (since we were not constructed at this time). + impl_checkRefDevice_nothrow( true ); } //------------------------------------------------------------------ @@ -124,6 +128,45 @@ void FmFormObj::ClearObjEnv() } //------------------------------------------------------------------ +void FmFormObj::impl_checkRefDevice_nothrow( bool _force ) +{ + const FmFormModel* pFormModel = PTR_CAST( FmFormModel, GetModel() ); + if ( !pFormModel || !pFormModel->ControlsUseRefDevice() ) + return; + + OutputDevice* pCurrentRefDevice = pFormModel ? pFormModel->GetRefDevice() : NULL; + if ( ( m_pLastKnownRefDevice == pCurrentRefDevice ) && !_force ) + return; + + Reference< XControlModel > xControlModel( GetUnoControlModel() ); + if ( !xControlModel.is() ) + return; + + m_pLastKnownRefDevice = pCurrentRefDevice; + if ( m_pLastKnownRefDevice == NULL ) + return; + + try + { + Reference< XPropertySet > xModelProps( GetUnoControlModel(), UNO_QUERY_THROW ); + Reference< XPropertySetInfo > xPropertyInfo( xModelProps->getPropertySetInfo(), UNO_SET_THROW ); + + static const ::rtl::OUString sRefDevicePropName( RTL_CONSTASCII_USTRINGPARAM( "ReferenceDevice" ) ); + if ( xPropertyInfo->hasPropertyByName( sRefDevicePropName ) ) + { + VCLXDevice* pUnoRefDevice = new VCLXDevice; + pUnoRefDevice->SetOutputDevice( m_pLastKnownRefDevice ); + Reference< XDevice > xRefDevice( pUnoRefDevice ); + xModelProps->setPropertyValue( sRefDevicePropName, makeAny( xRefDevice ) ); + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +//------------------------------------------------------------------ void FmFormObj::impl_isolateControlModel_nothrow() { try @@ -360,38 +403,10 @@ SdrObject* FmFormObj::Clone() const } //------------------------------------------------------------------ -void FmFormObj::ReformatText() +void FmFormObj::NbcReformatText() { - const FmFormModel* pFormModel = PTR_CAST( FmFormModel, GetModel() ); - OutputDevice* pCurrentRefDevice = pFormModel ? pFormModel->GetRefDevice() : NULL; - - if ( m_pLastKnownRefDevice != pCurrentRefDevice ) - { - m_pLastKnownRefDevice = pCurrentRefDevice; - - try - { - Reference< XPropertySet > xModelProps( GetUnoControlModel(), UNO_QUERY ); - Reference< XPropertySetInfo > xPropertyInfo; - if ( xModelProps.is() ) - xPropertyInfo = xModelProps->getPropertySetInfo(); - - const ::rtl::OUString sRefDevicePropName( RTL_CONSTASCII_USTRINGPARAM( "ReferenceDevice" ) ); - if ( xPropertyInfo.is() && xPropertyInfo->hasPropertyByName( sRefDevicePropName ) ) - { - VCLXDevice* pUnoRefDevice = new VCLXDevice; - pUnoRefDevice->SetOutputDevice( m_pLastKnownRefDevice ); - Reference< XDevice > xRefDevice( pUnoRefDevice ); - xModelProps->setPropertyValue( sRefDevicePropName, makeAny( xRefDevice ) ); - } - } - catch( const Exception& ) - { - OSL_ENSURE( sal_False, "FmFormObj::ReformatText: caught an exception!" ); - } - } - - SdrUnoObj::ReformatText(); + impl_checkRefDevice_nothrow( false ); + SdrUnoObj::NbcReformatText(); } //------------------------------------------------------------------ @@ -564,6 +579,13 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface > } //------------------------------------------------------------------ +void FmFormObj::SetModel( SdrModel* _pNewModel ) +{ + SdrUnoObj::SetModel( _pNewModel ); + impl_checkRefDevice_nothrow(); +} + +//------------------------------------------------------------------ FmFormObj* FmFormObj::GetFormObject( SdrObject* _pSdrObject ) { FmFormObj* pFormObject = dynamic_cast< FmFormObj* >( _pSdrObject ); @@ -595,6 +617,8 @@ void FmFormObj::SetUnoControlModel( const Reference< com::sun::star::awt::XContr SdrUnoObj::SetUnoControlModel( _rxModel ); // TODO: call something like formObjectInserted at the form page, to tell it the new model + + impl_checkRefDevice_nothrow( true ); } //------------------------------------------------------------------ diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 645787b518..801e3f613f 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -987,7 +987,7 @@ PopupMenu* FmXFormShell::GetConversionMenu() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::GetConversionMenu" ); const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - BOOL bIsHiContrastMode = rSettings.GetMenuColor().IsDark(); + BOOL bIsHiContrastMode = rSettings.GetHighContrastMode(); PopupMenu* pNewMenu = new PopupMenu(SVX_RES( RID_FMSHELL_CONVERSIONMENU )); @@ -2001,7 +2001,7 @@ bool FmXFormShell::setCurrentSelection( const InterfaceBag& _rSelection ) m_aCurrentSelection = _rSelection; - // determine the form which all the selected objécts belong to, if any + // determine the form which all the selected obj�cts belong to, if any Reference< XForm > xNewCurrentForm; for ( InterfaceBag::const_iterator loop = m_aCurrentSelection.begin(); loop != m_aCurrentSelection.end(); diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx index 4e28c62a83..d3dba436b4 100644 --- a/svx/source/form/formcontrolfactory.cxx +++ b/svx/source/form/formcontrolfactory.cxx @@ -44,8 +44,6 @@ #include <com/sun/star/form/FormComponentType.hpp> #include <com/sun/star/awt/ScrollBarOrientation.hpp> #include <com/sun/star/form/XGridColumnFactory.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/style/VerticalAlignment.hpp> #include <com/sun/star/awt/LineEndFormat.hpp> #include <com/sun/star/awt/ImageScaleMode.hpp> @@ -53,6 +51,7 @@ #include <com/sun/star/util/XNumberFormatTypes.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> #include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/awt/FontDescriptor.hpp> /** === end UNO includes === **/ #include <comphelper/componentcontext.hxx> @@ -88,15 +87,16 @@ namespace svxform using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::container::XChild; using ::com::sun::star::form::XGridColumnFactory; - using ::com::sun::star::lang::XServiceInfo; - using ::com::sun::star::style::XStyleFamiliesSupplier; - using ::com::sun::star::container::XNameAccess; using ::com::sun::star::style::VerticalAlignment_MIDDLE; using ::com::sun::star::beans::Property; using ::com::sun::star::uno::TypeClass_DOUBLE; using ::com::sun::star::uno::TypeClass_LONG; using ::com::sun::star::util::XNumberFormats; using ::com::sun::star::util::XNumberFormatTypes; + using ::com::sun::star::awt::FontDescriptor; + using ::com::sun::star::lang::Locale; + using ::com::sun::star::lang::XServiceInfo; + using ::com::sun::star::container::XNameAccess; /** === end UNO using === **/ namespace FormComponentType = ::com::sun::star::form::FormComponentType; namespace ScrollBarOrientation = ::com::sun::star::awt::ScrollBarOrientation; @@ -236,65 +236,6 @@ namespace svxform } return aInfo; } - /* - ATTENTION! - Broken for solaris? It seems that the old used template argument TYPE was already - defined as a macro ... which expand to ... "TYPE "!? - All platforms are OK - excepting Solaris. There the line "template< class TYPE >" - was expanded to "template < class TYPE " where the closing ">" was missing. - */ - #ifdef MYTYPE - #error "Who defines the macro MYTYPE, which is used as template argument here?" - #endif - - //.................................................................... - template< class MYTYPE > - Reference< MYTYPE > getTypedModelNode( const Reference< XInterface >& _rxModelNode ) - { - Reference< MYTYPE > xTypedNode( _rxModelNode, UNO_QUERY ); - if ( xTypedNode.is() ) - return xTypedNode; - else - { - Reference< XChild > xChild( _rxModelNode, UNO_QUERY ); - if ( xChild.is() ) - return getTypedModelNode< MYTYPE >( xChild->getParent() ); - else - return NULL; - } - } - - //.................................................................... - static bool lcl_getDocumentDefaultStyleAndFamily( const Reference< XInterface >& _rxDocument, ::rtl::OUString& _rFamilyName, ::rtl::OUString& _rStyleName ) SAL_THROW(( Exception )) - { - bool bSuccess = true; - Reference< XServiceInfo > xDocumentSI( _rxDocument, UNO_QUERY ); - if ( xDocumentSI.is() ) - { - if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) - || xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.WebDocument" ) ) ) - ) - { - _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphStyles" ) ); - _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ); - } - else if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ) ) ) ) - { - _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CellStyles" ) ); - _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Default" ) ); - } - else if ( xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) ) ) - || xDocumentSI->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) - ) - { - _rFamilyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "graphics" ) ); - _rStyleName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "standard" ) ); - } - else - bSuccess = false; - } - return bSuccess; - } //.................................................................... static const sal_Char* aCharacterAndParagraphProperties[] = @@ -430,41 +371,13 @@ namespace svxform //.................................................................... static void lcl_initializeCharacterAttributes( const Reference< XPropertySet >& _rxModel ) { - // need to initialize the attributes from the "Default" style of the document we live in - try { - // the style family collection - Reference< XStyleFamiliesSupplier > xSuppStyleFamilies = getTypedModelNode< XStyleFamiliesSupplier >( _rxModel.get() ); - Reference< XNameAccess > xStyleFamilies; - if ( xSuppStyleFamilies.is() ) - xStyleFamilies = xSuppStyleFamilies->getStyleFamilies(); - OSL_ENSURE( xStyleFamilies.is(), "lcl_initializeCharacterAttributes: could not obtain the style families!" ); - if ( !xStyleFamilies.is() ) - return; - - // the names of the family, and the style - depends on the document type we live in - ::rtl::OUString sFamilyName, sStyleName; - bool bKnownDocumentType = lcl_getDocumentDefaultStyleAndFamily( xSuppStyleFamilies.get(), sFamilyName, sStyleName ); - OSL_ENSURE( bKnownDocumentType, "lcl_initializeCharacterAttributes: Huh? What document type is this?" ); - if ( !bKnownDocumentType ) - return; - - // the concrete style - Reference< XNameAccess > xStyleFamily( xStyleFamilies->getByName( sFamilyName ), UNO_QUERY ); - Reference< XPropertySet > xStyle; - if ( xStyleFamily.is() ) - xStyleFamily->getByName( sStyleName ) >>= xStyle; - OSL_ENSURE( xStyle.is(), "lcl_initializeCharacterAttributes: could not retrieve the style!" ); - if ( !xStyle.is() ) - return; - - // transfer all properties which are described by the com.sun.star.style. - Reference< XPropertySetInfo > xSourcePropInfo( xStyle->getPropertySetInfo() ); - Reference< XPropertySetInfo > xDestPropInfo( _rxModel->getPropertySetInfo() ); - OSL_ENSURE( xSourcePropInfo.is() && xDestPropInfo.is(), "lcl_initializeCharacterAttributes: no property set info!" ); - if ( !xSourcePropInfo.is() || !xDestPropInfo.is() ) - return; + Reference< XPropertySet > xStyle( ControlLayouter::getDefaultDocumentTextStyle( _rxModel ), UNO_SET_THROW ); + + // transfer all properties which are described by the style + Reference< XPropertySetInfo > xSourcePropInfo( xStyle->getPropertySetInfo(), UNO_SET_THROW ); + Reference< XPropertySetInfo > xDestPropInfo( _rxModel->getPropertySetInfo(), UNO_SET_THROW ); ::rtl::OUString sPropertyName; const sal_Char** pCharacterProperty = aCharacterAndParagraphProperties; diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx index c5a5eb2391..5025337118 100644 --- a/svx/source/form/tbxform.cxx +++ b/svx/source/form/tbxform.cxx @@ -219,7 +219,7 @@ void SvxFmTbxCtlConfig::StateChanged(USHORT nSID, SfxItemState eState, const Sfx Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages(), - GetToolBox().GetDisplayBackground().GetColor().IsDark() ); + GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode() ); GetToolBox().SetItemImage( GetId(), aImage ); nLastSlot = nSlot; diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index ca5df8ff16..2c2d4d6900 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -1228,7 +1228,7 @@ IMPL_LINK( GalleryBrowser2, SelectTbxHdl, ToolBox*, pBox ) IMPL_LINK( GalleryBrowser2, MiscHdl, void*, EMPTYARG ) { - const sal_Bool bHC = GALLERY_DLG_COLOR.IsDark(); + const sal_Bool bHC = maViewBox.GetSettings().GetStyleSettings().GetHighContrastMode(); maViewBox.SetOutStyle( maMiscOptions.GetToolboxStyle() ); diff --git a/svx/source/inc/fmcontrollayout.hxx b/svx/source/inc/fmcontrollayout.hxx index 0424046c66..d7bdf85c4e 100644 --- a/svx/source/inc/fmcontrollayout.hxx +++ b/svx/source/inc/fmcontrollayout.hxx @@ -62,6 +62,22 @@ namespace svxform */ static bool useDynamicBorderColor( DocumentType _eDocType ); + /** determines whether for the given document type, form controls should use the document's reference device + for text rendering + */ + static bool useDocumentReferenceDevice( DocumentType _eDocType ); + + /** gets the "default" style in a document which can be used if some default text format is needed + + It depends on the type document type which concrete kind of style is returned, but it is expected to support + the css.style.CharacterProperties service. + + @param _rxModel + a form component. + */ + static ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > + getDefaultDocumentTextStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ); + private: ControlLayouter(); // never implemented diff --git a/svx/source/inc/fmobj.hxx b/svx/source/inc/fmobj.hxx index 3dd15fc1cd..ee765b45fd 100644 --- a/svx/source/inc/fmobj.hxx +++ b/svx/source/inc/fmobj.hxx @@ -86,12 +86,14 @@ public: virtual sal_uInt32 GetObjInventor() const; virtual sal_uInt16 GetObjIdentifier() const; - virtual void ReformatText(); + virtual void NbcReformatText(); virtual SdrObject* Clone() const; // #116235# virtual SdrObject* Clone(SdrPage* pPage, SdrModel* pModel) const; virtual void operator= (const SdrObject& rObj); + virtual void SetModel(SdrModel* pNewModel); + virtual void clonedFrom(const FmFormObj* _pSource); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> ensureModelEnv(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rSourceContainer, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer> _rTopLevelDestContainer); @@ -124,6 +126,10 @@ private: its parent. */ void impl_isolateControlModel_nothrow(); + + /** forwards the reference device of our SdrModel to the control model + */ + void impl_checkRefDevice_nothrow( bool _force = false ); }; diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx index dbee37d04b..ffea507995 100644 --- a/svx/source/msfilter/msdffimp.cxx +++ b/svx/source/msfilter/msdffimp.cxx @@ -317,7 +317,7 @@ BOOL Impl_OlePres::Read( SvStream & rStm ) { BYTE * p = new BYTE[ nSize ]; rStm.Read( p, nSize ); - delete p; + delete [] p; return FALSE; } return TRUE; @@ -5016,16 +5016,16 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r ApplyAttributes( rSt, aSet, aObjData ); pRet->SetMergedItemSet(aSet); } - else if ( aObjData.eShapeType == mso_sptLine )
- {
- basegfx::B2DPolygon aPoly;
- aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top()));
- aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom()));
- pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
- pRet->SetModel( pSdrModel );
- ApplyAttributes( rSt, aSet, aObjData );
- pRet->SetMergedItemSet(aSet);
- }
+ else if ( aObjData.eShapeType == mso_sptLine ) + { + basegfx::B2DPolygon aPoly; + aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top())); + aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom())); + pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly)); + pRet->SetModel( pSdrModel ); + ApplyAttributes( rSt, aSet, aObjData ); + pRet->SetMergedItemSet(aSet); + } else { if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) ) @@ -7099,6 +7099,8 @@ BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect aZCodec.Decompress( rBLIPStream, *pOut ); aZCodec.EndCompression(); pOut->Seek( STREAM_SEEK_TO_BEGIN ); + pOut->SetResizeOffset( 0 ); // sj: #i102257# setting ResizeOffset of 0 prevents from seeking + // behind the stream end (allocating too much memory) pGrStream = pOut; } @@ -8184,6 +8186,7 @@ void SvxMSDffManager::removeShapeId( SdrObject* pShape ) maShapeIdContainer.erase( aIter ); break; } + aIter++; } } diff --git a/svx/source/msfilter/msocximex.cxx b/svx/source/msfilter/msocximex.cxx index 493e097857..5abf32ce3d 100644 --- a/svx/source/msfilter/msocximex.cxx +++ b/svx/source/msfilter/msocximex.cxx @@ -5299,7 +5299,7 @@ sal_Bool OCX_Image::Read(SotStorageStream *pS) bool result = storePictureInFileSystem( sImageUrl, pImage, nImageLen ); OUString pictName = sImageUrl.copy( sImageUrl.lastIndexOf('/') + 1 ); result = storePictureInDoc( pDocSh, pictName, pImage, nImageLen ); - delete pImage; + delete [] pImage; } return sal_True; } diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index ef7df1ae32..28ab8cbff6 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -39,6 +39,7 @@ #include <svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> +#include <svx/obj3d.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -134,6 +135,7 @@ namespace sdr // create Primitive2DSequence from sub-geometry const SdrObject* pSdrObjRepresentation = GetCustomShapeObj().GetSdrObjectFromCustomShape(); + bool b3DShape(false); if(pSdrObjRepresentation) { @@ -142,6 +144,12 @@ namespace sdr while(aIterator.IsMore()) { SdrObject& rCandidate = *aIterator.Next(); + + if(!b3DShape && dynamic_cast< E3dObject* >(&rCandidate)) + { + b3DShape = true; + } + const drawinglayer::primitive2d::Primitive2DSequence xNew(rCandidate.GetViewContact().getViewIndependentPrimitive2DSequence()); drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xGroup, xNew); } @@ -220,7 +228,8 @@ namespace sdr xGroup, aTextBoxMatrix, bWordWrap, - false)); // #SJ# New parameter to force to clipped BlockText for SC + false, // #SJ# New parameter to force to clipped BlockText for SC + b3DShape)); xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx index 454b68cbfb..3facc1c031 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -113,6 +113,11 @@ namespace sdr new drawinglayer::primitive2d::SdrOleContentPrimitive2D( GetOle2Obj(), aObjectMatrix, + + // #i104867# add GraphicVersion number to be able to check for + // content change in the primitive later + GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(), + bHighContrast)); // create primitive. Use Ole2 primitive here. Prepare attribute settings, will be used soon anyways. diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx index 9c7810ea46..f9113d7b64 100644 --- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx @@ -39,6 +39,7 @@ #include <svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx> #include <svtools/itemset.hxx> #include <svx/sdr/primitive2d/sdrprimitivetools.hxx> +#include <svx/svdmodel.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -104,6 +105,10 @@ namespace sdr double fCornerRadiusY; drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY); + // #i105856# use knowledge about pickthrough from the model + const bool bPickThroughTransparentTextFrames( + GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames()); + // create primitive const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::SdrRectanglePrimitive2D( @@ -111,7 +116,8 @@ namespace sdr *pAttribute, fCornerRadiusX, fCornerRadiusY, - GetRectObj().IsTextFrame())); + // #i105856# use fill for HitTest when TextFrame and not PickThrough + GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames)); xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx index f77b533a0e..64ac530e55 100644 --- a/svx/source/sdr/overlay/overlaymanager.cxx +++ b/svx/source/sdr/overlay/overlaymanager.cxx @@ -44,6 +44,10 @@ ////////////////////////////////////////////////////////////////////////////// +using namespace com::sun::star; + +////////////////////////////////////////////////////////////////////////////// + namespace sdr { namespace overlay @@ -140,6 +144,18 @@ namespace sdr maViewInformation2D(0), mfDiscreteOne(0.0) { + // set Property 'ReducedDisplayQuality' to true to allow simpler interaction + // visualisations + static bool bUseReducedDisplayQualityForDrag(true); + + if(bUseReducedDisplayQualityForDrag) + { + uno::Sequence< beans::PropertyValue > xProperties(1); + xProperties[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedDisplayQuality")); + xProperties[0].Value <<= true; + maViewInformation2D = drawinglayer::geometry::ViewInformation2D(xProperties); + } + if(pOldOverlayManager) { // take over OverlayObjects from given OverlayManager. Copy diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index 91393a4047..31fe3da220 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -370,6 +370,9 @@ namespace sdr OverlayManager::ImpDrawMembers(aBufferRememberedRangeLogic, getOutputDevice()); } + // #i80730# removed: VCL hack for transparent child windows + // No longer needed, checked in DEV300 m54 + // #i80730# restore visibility of VCL cursor if(bCursorWasEnabled) { diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx index e38cb57378..93e8b3a6e7 100644 --- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx @@ -68,7 +68,20 @@ namespace drawinglayer // add shadow if(aRetval.hasElements() && getSdrSTAttribute().getShadow()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow()); + // #i105323# add generic shadow only for 2D shapes. For + // 3D shapes shadow will be set at the individual created + // visualisation objects and be visualized by the 3d renderer + // as a single shadow. + // + // The shadow for AutoShapes could be handled uniformely by not setting any + // shadow items at the helper model objects and only adding shadow here for + // 2D and 3D (and it works, too), but this would lead to two 3D scenes for + // the 3D object; one for the shadow aond one for the content. The one for the + // shadow will be correct (using ColorModifierStack), but expensive. + if(!get3DShape()) + { + aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow()); + } } return aRetval; @@ -79,13 +92,15 @@ namespace drawinglayer const Primitive2DSequence& rSubPrimitives, const basegfx::B2DHomMatrix& rTextBox, bool bWordWrap, - bool bForceTextClipToTextRange) + bool bForceTextClipToTextRange, + bool b3DShape) : BasePrimitive2D(), maSdrSTAttribute(rSdrSTAttribute), maSubPrimitives(rSubPrimitives), maTextBox(rTextBox), mbWordWrap(bWordWrap), - mbForceTextClipToTextRange(bForceTextClipToTextRange) + mbForceTextClipToTextRange(bForceTextClipToTextRange), + mb3DShape(b3DShape) { } @@ -99,7 +114,8 @@ namespace drawinglayer && getSubPrimitives() == rCompare.getSubPrimitives() && getTextBox() == rCompare.getTextBox() && getWordWrap() == rCompare.getWordWrap() - && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange()); + && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange() + && get3DShape() == rCompare.get3DShape()); } return false; diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index 9d58a01d55..ce9f40037c 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -52,27 +52,29 @@ namespace drawinglayer namespace primitive2d { Primitive2DReference SdrMeasurePrimitive2D::impCreatePart( + const attribute::SdrLineAttribute& rLineAttribute, const basegfx::B2DHomMatrix& rObjectMatrix, const basegfx::B2DPoint& rStart, const basegfx::B2DPoint& rEnd, bool bLeftActive, bool bRightActive) const { + const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd(); basegfx::B2DPolygon aPolygon; + aPolygon.append(rStart); aPolygon.append(rEnd); - if(!getSdrLSTAttribute().getLineStartEnd() || (!bLeftActive && !bRightActive)) + if(!pLineStartEnd || (!bLeftActive && !bRightActive)) { - return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), 0L); + return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, 0); } if(bLeftActive && bRightActive) { - return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), getSdrLSTAttribute().getLineStartEnd()); + return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, pLineStartEnd); } - const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd(); const basegfx::B2DPolyPolygon aEmpty; const attribute::SdrLineStartEndAttribute aLineStartEnd( bLeftActive ? pLineStartEnd->getStartPolyPolygon() : aEmpty, bRightActive ? pLineStartEnd->getEndPolyPolygon() : aEmpty, @@ -80,7 +82,7 @@ namespace drawinglayer bLeftActive ? pLineStartEnd->isStartActive() : false, bRightActive ? pLineStartEnd->isEndActive() : false, bLeftActive ? pLineStartEnd->isStartCentered() : false, bRightActive? pLineStartEnd->isEndCentered() : false); - return createPolygonLinePrimitive(aPolygon, rObjectMatrix, *getSdrLSTAttribute().getLine(), &aLineStartEnd); + return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, &aLineStartEnd); } Primitive2DSequence SdrMeasurePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const @@ -278,12 +280,12 @@ namespace drawinglayer const basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY()); const basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY()); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainLeftLeft, aMainLeft, false, true)); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainRight, aMainRightRight, true, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeftLeft, aMainLeft, false, true)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainRight, aMainRightRight, true, false)); if(!bMainLineSplitted || MEASURETEXTPOSITION_CENTERED != eHorizontal) { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainLeft, aMainRight, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(* pLineAttribute, aObjectMatrix, aMainLeft, aMainRight, false, false)); } } else @@ -294,12 +296,12 @@ namespace drawinglayer const basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY()); const basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY()); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainLeft, aMainInnerLeft, true, false)); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainInnerRight, aMainRight, false, true)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeft, aMainInnerLeft, true, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainInnerRight, aMainRight, false, true)); } else { - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aMainLeft, aMainRight, true, true)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeft, aMainRight, true, true)); } } @@ -312,13 +314,13 @@ namespace drawinglayer const basegfx::B2DPoint aLeftUp(0.0, fTopEdge); const basegfx::B2DPoint aLeftDown(0.0, fBottomLeft); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aLeftDown, aLeftUp, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aLeftDown, aLeftUp, false, false)); // right help line const basegfx::B2DPoint aRightUp(fDistance, fTopEdge); const basegfx::B2DPoint aRightDown(fDistance, fBottomRight); - appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(aObjectMatrix, aRightDown, aRightUp, false, false)); + appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aRightDown, aRightUp, false, false)); // text horizontal position if(MEASURETEXTPOSITION_NEGATIVE == eHorizontal) diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx index 9c5616ebff..164e122e67 100644 --- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx @@ -157,10 +157,12 @@ namespace drawinglayer SdrOleContentPrimitive2D::SdrOleContentPrimitive2D( const SdrOle2Obj& rSdrOle2Obj, const basegfx::B2DHomMatrix& rObjectTransform, + sal_uInt32 nGraphicVersion, bool bHighContrast) : BasePrimitive2D(), mpSdrOle2Obj(const_cast< SdrOle2Obj* >(&rSdrOle2Obj)), maObjectTransform(rObjectTransform), + mnGraphicVersion(nGraphicVersion), mbHighContrast(bHighContrast) { } @@ -176,6 +178,11 @@ namespace drawinglayer return ((bBothNot || bBothAndEqual) && getObjectTransform() == rCompare.getObjectTransform() + + // #i104867# to find out if the Graphic content of the + // OLE has changed, use GraphicVersion number + && getGraphicVersion() == rCompare.getGraphicVersion() + && getHighContrast() == rCompare.getHighContrast()); } diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx index 209684653a..6449859318 100644 --- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx @@ -68,7 +68,7 @@ namespace drawinglayer *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient())); } - else if(getTextFrame()) + else if(getForceFillForHitTest()) { // if no fill and it's a text frame, create a fill for HitTest and // BoundRect fallback @@ -89,7 +89,7 @@ namespace drawinglayer getTransform(), *getSdrLFSTAttribute().getLine())); } - else if(!getTextFrame()) + else if(!getForceFillForHitTest()) { // if initially no line is defined and it's not a text frame, create // a line for HitTest and BoundRect @@ -127,13 +127,13 @@ namespace drawinglayer const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute, double fCornerRadiusX, double fCornerRadiusY, - bool bTextFrame) + bool bForceFillForHitTest) : BasePrimitive2D(), maTransform(rTransform), maSdrLFSTAttribute(rSdrLFSTAttribute), mfCornerRadiusX(fCornerRadiusX), mfCornerRadiusY(fCornerRadiusY), - mbTextFrame(bTextFrame) + mbForceFillForHitTest(bForceFillForHitTest) { } @@ -147,7 +147,7 @@ namespace drawinglayer && getCornerRadiusY() == rCompare.getCornerRadiusY() && getTransform() == rCompare.getTransform() && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute() - && getTextFrame() == rCompare.getTextFrame()); + && getForceFillForHitTest() == rCompare.getForceFillForHitTest()); } return false; diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx index 554366c9f1..32c930f123 100644 --- a/svx/source/stbctrls/xmlsecctrl.cxx +++ b/svx/source/stbctrls/xmlsecctrl.cxx @@ -97,12 +97,12 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( USHORT _nSlotId, USHORT _nId, S { mpImpl->mnState = (UINT16)SIGNATURESTATE_UNKNOWN; - sal_Bool bIsDark = GetStatusBar().GetBackground().GetColor().IsDark(); - mpImpl->maImage = Image( SVX_RES( bIsDark ? RID_SVXBMP_SIGNET_H : RID_SVXBMP_SIGNET ) ); + sal_Bool bHC = GetStatusBar().GetSettings().GetStyleSettings().GetHighContrastMode(); + mpImpl->maImage = Image( SVX_RES( bHC ? RID_SVXBMP_SIGNET_H : RID_SVXBMP_SIGNET ) ); mpImpl->maImageBroken = - Image( SVX_RES( bIsDark ? RID_SVXBMP_SIGNET_BROKEN_H : RID_SVXBMP_SIGNET_BROKEN ) ); + Image( SVX_RES( bHC ? RID_SVXBMP_SIGNET_BROKEN_H : RID_SVXBMP_SIGNET_BROKEN ) ); mpImpl->maImageNotValidated = - Image( SVX_RES( bIsDark ? RID_SVXBMP_SIGNET_NOTVALIDATED_H : RID_SVXBMP_SIGNET_NOTVALIDATED ) ); + Image( SVX_RES( bHC ? RID_SVXBMP_SIGNET_NOTVALIDATED_H : RID_SVXBMP_SIGNET_NOTVALIDATED ) ); } XmlSecStatusBarControl::~XmlSecStatusBarControl() diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx index a452521ed2..9807144d78 100644 --- a/svx/source/stbctrls/zoomsliderctrl.cxx +++ b/svx/source/stbctrls/zoomsliderctrl.cxx @@ -188,10 +188,10 @@ SvxZoomSliderControl::SvxZoomSliderControl( USHORT _nSlotId, USHORT _nId, Statu SfxStatusBarControl( _nSlotId, _nId, _rStb ), mpImpl( new SvxZoomSliderControl_Impl ) { - const sal_Bool bIsDark = GetStatusBar().GetBackground().GetColor().IsDark(); - mpImpl->maSliderButton = Image( SVX_RES( bIsDark ? RID_SVXBMP_SLIDERBUTTON_HC : RID_SVXBMP_SLIDERBUTTON ) ); - mpImpl->maIncreaseButton = Image( SVX_RES( bIsDark ? RID_SVXBMP_SLIDERINCREASE_HC : RID_SVXBMP_SLIDERINCREASE ) ); - mpImpl->maDecreaseButton = Image( SVX_RES( bIsDark ? RID_SVXBMP_SLIDERDECREASE_HC : RID_SVXBMP_SLIDERDECREASE ) ); + const sal_Bool bHC = GetStatusBar().GetSettings().GetStyleSettings().GetHighContrastMode(); + mpImpl->maSliderButton = Image( SVX_RES( bHC ? RID_SVXBMP_SLIDERBUTTON_HC : RID_SVXBMP_SLIDERBUTTON ) ); + mpImpl->maIncreaseButton = Image( SVX_RES( bHC ? RID_SVXBMP_SLIDERINCREASE_HC : RID_SVXBMP_SLIDERINCREASE ) ); + mpImpl->maDecreaseButton = Image( SVX_RES( bHC ? RID_SVXBMP_SLIDERDECREASE_HC : RID_SVXBMP_SLIDERDECREASE ) ); } // ----------------------------------------------------------------------- diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 93d9b9c907..47f7324b8a 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -206,6 +206,32 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragEntrySdrObject::createPrim //////////////////////////////////////////////////////////////////////////////////////////////////// +SdrDragEntryPrimitive2DSequence::SdrDragEntryPrimitive2DSequence( + const drawinglayer::primitive2d::Primitive2DSequence& rSequence, + bool bAddToTransparent) +: SdrDragEntry(), + maPrimitive2DSequence(rSequence) +{ + // add parts to transparent overlay stuff eventually + setAddToTransparent(bAddToTransparent); +} + +SdrDragEntryPrimitive2DSequence::~SdrDragEntryPrimitive2DSequence() +{ +} + +drawinglayer::primitive2d::Primitive2DSequence SdrDragEntryPrimitive2DSequence::createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) +{ + drawinglayer::primitive2d::Primitive2DReference aTransformPrimitive2D( + new drawinglayer::primitive2d::TransformPrimitive2D( + rDragMethod.getCurrentTransformation(), + maPrimitive2DSequence)); + + return drawinglayer::primitive2d::Primitive2DSequence(&aTransformPrimitive2D, 1); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// + SdrDragEntryPointGlueDrag::SdrDragEntryPointGlueDrag(const std::vector< basegfx::B2DPoint >& rPositions, bool bIsPointDrag) : maPositions(rPositions), mbIsPointDrag(bIsPointDrag) @@ -318,6 +344,13 @@ void SdrDragMethod::createSdrDragEntries() } } +void SdrDragMethod::createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool bModify) +{ + // add full obejct drag; Clone() at the object has to work + // for this + addSdrDragEntry(new SdrDragEntrySdrObject(rOriginal, rObjectContact, bModify)); +} + void SdrDragMethod::createSdrDragEntries_SolidDrag() { const sal_uInt32 nMarkAnz(getSdrDragView().GetMarkedObjectCount()); @@ -359,7 +392,7 @@ void SdrDragMethod::createSdrDragEntries_SolidDrag() { // add full obejct drag; Clone() at the object has to work // for this - addSdrDragEntry(new SdrDragEntrySdrObject(*pCandidate, rOC, true)); + createSdrDragEntryForSdrObject(*pCandidate, rOC, true); } if(bAddWireframe) @@ -1358,6 +1391,21 @@ Pointer SdrDragObjOwn::GetSdrDragPointer() const TYPEINIT1(SdrDragMove,SdrDragMethod); +void SdrDragMove::createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool /*bModify*/) +{ + // for SdrDragMove, use current Primitive2DSequence of SdrObject visualisation + // in given ObjectContact directly + sdr::contact::ViewContact& rVC = rOriginal.GetViewContact(); + sdr::contact::ViewObjectContact& rVOC = rVC.GetViewObjectContact(rObjectContact); + sdr::contact::DisplayInfo aDisplayInfo; + + // Do not use the last ViewPort set at the OC from the last ProcessDisplay(), + // here we want the complete primitive sequence without visibility clippings + rObjectContact.resetViewPort(); + + addSdrDragEntry(new SdrDragEntryPrimitive2DSequence(rVOC.getPrimitive2DSequenceHierarchy(aDisplayInfo), true)); +} + void SdrDragMove::applyCurrentTransformationToSdrObject(SdrObject& rTarget) { rTarget.Move(Size(DragStat().GetDX(), DragStat().GetDY())); diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx index dbf535ba0a..0ecf714548 100644 --- a/svx/source/svdraw/svdfppt.cxx +++ b/svx/source/svdraw/svdfppt.cxx @@ -7662,7 +7662,7 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl } } -SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTableArry, SvxMSDffSolverContainer* pSolverContainer ) const +SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTableArry, SvxMSDffSolverContainer* pSolverContainer ) { SdrObject* pRet = pGroup; sal_uInt32 nRows = pTableArry[ 1 ]; @@ -7786,6 +7786,15 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab pTable->uno_unlock(); pTable->SetSnapRect( pGroup->GetSnapRect() ); pRet = pTable; + + //Remove Objects from shape map + SdrObjListIter aIter( *pGroup, IM_DEEPWITHGROUPS ); + while( aIter.IsMore() ) + { + SdrObject* pPartObj = aIter.Next(); + removeShapeId( pPartObj ); + } + SdrObject::Free( pGroup ); } catch( Exception& ) diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 7c415cefb0..f5df1658b3 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -2004,7 +2004,7 @@ void SdrHdlList::TravelFocusHdl(sal_Bool bForward) } // #105678# free mem again - delete pHdlAndIndex; + delete [] pHdlAndIndex; } } diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index f8220ad472..44a29c619b 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1673,6 +1673,12 @@ void SdrObjCustomShape::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const } } +void SdrObjCustomShape::SetModel(SdrModel* pNewModel)
+{
+ SdrTextObj::SetModel(pNewModel);
+ mXRenderedCustomShape.clear();
+}
+ UINT16 SdrObjCustomShape::GetObjIdentifier() const { return UINT16(OBJ_CUSTOMSHAPE); diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index 01f68240f9..c3bc05a560 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -137,7 +137,7 @@ void ExtrusionDirectionWindow::implInit() mpDirectionSet->SetColCount( 3 ); mpDirectionSet->EnableFullItemMode( FALSE ); - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); for( i = DIRECTION_NW; i <= DIRECTION_SE; i++ ) { @@ -174,7 +174,7 @@ void ExtrusionDirectionWindow::DataChanged( const DataChangedEvent& rDCEvt ) if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) ) { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); USHORT i; for( i = DIRECTION_NW; i <= DIRECTION_SE; i++ ) @@ -514,7 +514,7 @@ void ExtrusionDepthWindow::implInit() mpMenu->SetSelectHdl( LINK( this, ExtrusionDepthWindow, SelectHdl ) ); - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); String aEmpty; mpMenu->appendEntry( 0, aEmpty, bHighContrast ? maImgDepth0h : maImgDepth0 ); @@ -635,7 +635,7 @@ void ExtrusionDepthWindow::DataChanged( const DataChangedEvent& rDCEvt ) if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) ) { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); mpMenu->setEntryImage( 0, bHighContrast ? maImgDepth0h : maImgDepth0 ); mpMenu->setEntryImage( 1, bHighContrast ? maImgDepth1h : maImgDepth1 ); @@ -882,7 +882,7 @@ void ExtrusionLightingWindow::implInit() mpLightingSet->SetColCount( 3 ); mpLightingSet->EnableFullItemMode( FALSE ); - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); for( i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; i++ ) { @@ -949,7 +949,7 @@ void ExtrusionLightingWindow::implSetDirection( int nDirection, bool bEnabled ) mnDirection = nDirection; mbDirectionEnabled = bEnabled; - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); if( !bEnabled ) nDirection = FROM_FRONT; @@ -1022,7 +1022,7 @@ void ExtrusionLightingWindow::DataChanged( const DataChangedEvent& rDCEvt ) if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) ) { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); implSetDirection( mnDirection, mbDirectionEnabled ); mpMenu->setEntryImage( 0, bHighContrast ? maImgBrighth : maImgBright ); @@ -1231,7 +1231,7 @@ void ExtrusionSurfaceWindow::implInit() { SetHelpId( HID_POPUP_EXTRUSION_SURFACE ); - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); // mpSurfaceForewarder = new SfxStatusForwarder( SID_EXTRUSION_SURFACE, *this ); @@ -1316,7 +1316,7 @@ void ExtrusionSurfaceWindow::DataChanged( const DataChangedEvent& rDCEvt ) if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) ) { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); mpMenu->appendEntry( 0, String( SVX_RES( STR_WIREFRAME ) ), bHighContrast ? maImgSurface1h : maImgSurface1 ); mpMenu->appendEntry( 1, String( SVX_RES( STR_MATTE ) ), bHighContrast ? maImgSurface2h : maImgSurface2 ); diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 7cb779974b..4e5e3e396b 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -397,7 +397,7 @@ void FontWorkAlignmentWindow::implInit() { SetHelpId( HID_POPUP_FONTWORK_ALIGN ); - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); mpMenu->SetHelpId( HID_POPUP_FONTWORK_ALIGN ); @@ -477,7 +477,7 @@ void FontWorkAlignmentWindow::DataChanged( const DataChangedEvent& rDCEvt ) if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) ) { - bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); + bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); mpMenu->appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 ); mpMenu->appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 ); @@ -637,7 +637,7 @@ void FontWorkCharacterSpacingWindow::implInit() { SetHelpId( HID_POPUP_FONTWORK_CHARSPACE ); -// bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); +// bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); mpMenu->SetHelpId( HID_POPUP_FONTWORK_CHARSPACE ); @@ -754,7 +754,7 @@ void FontWorkCharacterSpacingWindow::DataChanged( const DataChangedEvent& rDCEvt if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) ) { -// bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); +// bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); mpMenu->appendEntry( 0, String( SVX_RES( STR_CHARS_SPACING_VERY_TIGHT ) ), MIB_CHECKABLE ); mpMenu->appendEntry( 1, String( SVX_RES( STR_CHARS_SPACING_TIGHT ) ), MIB_CHECKABLE ); diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index d8921d4fe5..66bd3e6b7b 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -74,7 +74,7 @@ using namespace ::com::sun::star::beans; SvxLineBox::SvxLineBox( Window* pParent, const Reference< XFrame >& rFrame, WinBits nBits ) : LineLB( pParent, nBits ), - meBmpMode ( GetDisplayBackground().GetColor().IsDark() ? BMP_COLOR_HIGHCONTRAST : BMP_COLOR_NORMAL ), + meBmpMode ( GetSettings().GetStyleSettings().GetHighContrastMode() ? BMP_COLOR_HIGHCONTRAST : BMP_COLOR_NORMAL ), nCurPos ( 0 ), aLogicalSize(40,140), bRelease ( TRUE ), @@ -268,7 +268,7 @@ void SvxLineBox::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - BmpColorMode eMode = GetDisplayBackground().GetColor().IsDark() ? BMP_COLOR_HIGHCONTRAST : BMP_COLOR_NORMAL; + BmpColorMode eMode = GetSettings().GetStyleSettings().GetHighContrastMode() ? BMP_COLOR_HIGHCONTRAST : BMP_COLOR_NORMAL; if( eMode != meBmpMode ) { meBmpMode = eMode; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 94494aa3aa..bca857ea25 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -282,7 +282,7 @@ public: inline BOOL SvxFrameWindow_Impl::IsHighContrast( void ) const { - return GetDisplayBackground().GetColor().IsDark(); + return GetSettings().GetStyleSettings().GetHighContrastMode(); } //======================================================================== diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index d19acf5a9f..13469d3d91 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -63,7 +63,7 @@ namespace svx if (mnSlotId == SID_BACKGROUND_COLOR) mnDrawMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW; DBG_ASSERT( ptrTbx, "ToolBox not found :-(" ); - mbWasHiContrastMode = ptrTbx ? ( ptrTbx->GetBackground().GetColor().IsDark() ) : FALSE; + mbWasHiContrastMode = ptrTbx ? ( ptrTbx->GetSettings().GetStyleSettings().GetHighContrastMode() ) : FALSE; Update(mnSlotId == SID_ATTR_CHAR_COLOR2 ? COL_BLACK : COL_GRAY); } @@ -79,7 +79,7 @@ namespace svx { Image aImage( mpTbx->GetItemImage( mnBtnId ) ); const bool bSizeChanged = ( maBmpSize != aImage.GetSizePixel() ); - const bool bDisplayModeChanged = ( mbWasHiContrastMode != mpTbx->GetBackground().GetColor().IsDark() ); + const bool bDisplayModeChanged = ( mbWasHiContrastMode != mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode() ); Color aColor( rColor ); // !!! #109290# Workaround for SetFillColor with COL_AUTO @@ -107,7 +107,7 @@ namespace svx else pMskAcc = NULL; - mbWasHiContrastMode = mpTbx->GetBackground().GetColor().IsDark(); + mbWasHiContrastMode = mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode(); if( mnDrawMode == TBX_UPDATER_MODE_CHAR_COLOR_NEW && ( COL_TRANSPARENT != aColor.GetColor() ) ) pBmpAcc->SetLineColor( aColor ); |