core.git: include/svx sd/source svx/source
include/svx/svdmodel.hxx |8 +++--- sd/source/filter/pdf/sdpdffilter.cxx |4 ++- svx/source/svdraw/svdmodel.cxx | 46 ++- 3 files changed, 31 insertions(+), 27 deletions(-) New commits: commit ad3fa69eeb89573c77feba64dab3380154a90953 Author: Noel Grandin AuthorDate: Fri Sep 6 12:55:26 2024 +0200 Commit: Noel Grandin CommitDate: Fri Sep 6 14:48:17 2024 +0200 reduce time spent in RecalcPageNums when importing PDF when we have lots of pages, we trigger a O(n^2) loop. Do two things to reduce this (a) be smarter about recalculating page numbers, so we only recalculate the set of page numbers that need recalculating (b) duplicate the last page repeatedly, instead of the first page, so we don't recalculate all the page numbers for each page we duplicate Change-Id: I40aca812b47a9551039c5855b1c8d26f5f171f41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172942 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 3da5a865fe13..b0d8bd7b36a5 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -199,12 +199,12 @@ protected: std::deque> m_aRedoStack; std::unique_ptr m_pCurrentUndoGroup; // For multi-level sal_uInt16 m_nUndoLevel; // undo nesting +sal_uInt16 m_nPageNumsDirtyFrom = SAL_MAX_UINT16; +sal_uInt16 m_nMasterPageNumsDirtyFrom = SAL_MAX_UINT16; boolm_bIsWriter:1;// to clean up pMyPool from 303a boolm_bThemedControls:1; // If false UnoControls should not use theme colors boolmbUndoEnabled:1; // If false no undo is recorded or we are during the execution of an undo action boolmbChanged:1; -boolm_bPagNumsDirty:1; -boolm_bMPgNumsDirty:1; boolm_bTransportContainer:1; // doc is temporary object container, no display (e.g. clipboard) boolm_bReadOnly:1; boolm_bTransparentTextFrames:1; @@ -397,8 +397,8 @@ public: static OUString GetPercentString(const Fraction& rVal); // RecalcPageNums is ordinarily only called by the Page. -bool IsPagNumsDirty() const { return m_bPagNumsDirty; }; -bool IsMPgNumsDirty() const { return m_bMPgNumsDirty; }; +bool IsPagNumsDirty() const { return m_nPageNumsDirtyFrom != SAL_MAX_UINT16; } +bool IsMPgNumsDirty() const { return m_nMasterPageNumsDirtyFrom != SAL_MAX_UINT16; } void RecalcPageNums(bool bMaster); // After the Insert the Page belongs to the SdrModel. virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0x); diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index 9e6597ce..068aca1fcce9 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -65,9 +65,11 @@ bool SdPdfFilter::Import() // Add as many pages as we need up-front. mrDocument.CreateFirstPages(); +sal_uInt16 nPageToDuplicate = 0; for (size_t i = 0; i < aGraphics.size() - 1; ++i) { -mrDocument.DuplicatePage(0); +// duplicating the last page is cheaper than repeatedly duplicating the first one +nPageToDuplicate = mrDocument.DuplicatePage(nPageToDuplicate); } for (vcl::PDFGraphicResult const& rPDFGraphicResult : aGraphics) diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index e13f1025430a..45bb96a2177b 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -132,8 +132,6 @@ SdrModel::SdrModel(SfxItemPool* pPool, comphelper::IEmbeddedHelper* pEmbeddedHel , m_bThemedControls(true) , mbUndoEnabled(true) , mbChanged(false) -, m_bPagNumsDirty(false) -, m_bMPgNumsDirty(false) , m_bTransportContainer(false) , m_bReadOnly(false) , m_bTransparentTextFrames(false) @@ -1175,23 +1173,27 @@ void SdrModel::RecalcPageNums(bool bMaster) { if(bMaster) { -sal_uInt16 nCount=sal_uInt16(maMasterPages.size()); -sal_uInt16 i; -for (i=0; iSetPageNum(i); +if (m_nMasterPageNumsDirtyFrom != SAL_MAX_UINT16) +{ +sal_uInt16 nCount=sal_uInt16(maMasterPages.size()); +for (sal_uInt16 i=m_nMasterPageNumsDirtyFrom; iSetPageNum(i); +} +m_nMasterPageNumsDirtyFrom = SAL_MAX_UINT16; } -m_bMPgNumsDirty=false; } else { -sal_uInt16 nCount=sal_uInt16(maPages.size()); -sal_uInt16 i; -for (i=0; iSetPageNum(i); +if (m_nPageNumsDirtyFrom != SAL_MAX_UINT16) +{ +sal_uInt16 nCount=sal
core.git: include/svx sd/source svx/source
include/svx/svdmodel.hxx |3 +++ sd/source/core/drawdoc.cxx|2 ++ svx/source/svdraw/svdmrkv.cxx |3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) New commits: commit 558b1a9155dc6918a0731277330e27c2f72b7b13 Author: Gökay Şatır AuthorDate: Wed Aug 7 16:55:42 2024 +0300 Commit: Gökay ŞATIR CommitDate: Wed Sep 4 16:47:20 2024 +0200 Add SdrModel "IsImpress" function. Functionalities like "SetMarkHandlesForLOKit" can now use this to send data selectively. Change-Id: I8d300d1d6fe0d953f4798ec3ee0c48e258054335 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172854 Reviewed-by: Gökay ŞATIR Tested-by: Jenkins diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index ffd89a7dfda2..3da5a865fe13 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -269,12 +269,15 @@ private: // used to disable unique name checking during page move bool mbMakePageObjectsNamesUnique = true; +bool m_bIsImpress = false; public: SVX_DLLPRIVATE virtual bool IsCreatingDataObj() const { return false; } bool IsTransportContainer() const { return m_bTransportContainer; } bool AreControlsThemed() { return m_bThemedControls; } bool IsPasteResize() const{ return m_bPasteResize; } +bool IsImpress() const { return m_bIsImpress; } +void SetImpress(bool bIsImpress) { m_bIsImpress = bIsImpress; }; void SetPasteResize(bool bOn) { m_bPasteResize=bOn; } // If a custom Pool is put here, the class will call methods // on it (Put(), Remove()). On disposal of SdrModel the pool diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 4c411f94f6f7..7bce90338b38 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -146,6 +146,8 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) mpDrawPageListWatcher.reset(new ImpDrawPageListWatcher(*this)); mpMasterPageListWatcher.reset(new ImpMasterPageListWatcher(*this)); +this->SetImpress(true); + InitLayoutVector(); InitObjectVector(); SetObjectShell(pDrDocSh); // for VCDrawModel diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 45c8072038bc..8526e7e51f17 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -1223,7 +1223,8 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S } SdrPage *pPage = pPageView ? pPageView->GetPage(): nullptr; -if (pPage) + +if (pPage && getSdrModelFromSdrView().IsImpress()) { // Send all objects' rectangles along with the selected object's information. // Other rectangles can be used for aligning the selected object referencing the others.
core.git: include/svx sd/source svx/source
include/svx/annotation/Annotation.hxx | 15 +++ include/svx/annotation/AnnotationObject.hxx |2 ++ include/svx/annotation/ObjectAnnotationData.hxx |8 +++- include/svx/svdpage.hxx |1 + sd/source/core/annotations/Annotation.cxx |9 +++-- svx/source/annotation/Annotation.cxx|1 + 6 files changed, 33 insertions(+), 3 deletions(-) New commits: commit 46c261603fc60ad30e80cbf6903b573ac98a66ee Author: Tomaž Vajngerl AuthorDate: Mon Jun 10 13:41:51 2024 +0900 Commit: Tomaž Vajngerl CommitDate: Tue Jun 11 14:44:37 2024 +0200 annot: document new annotation classes and methods Change-Id: I71d1055a30e0e8eedcd8fa71b47e74e90f1aac93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168595 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/svx/annotation/Annotation.hxx b/include/svx/annotation/Annotation.hxx index 8ea57af4d88f..436827b13fc6 100644 --- a/include/svx/annotation/Annotation.hxx +++ b/include/svx/annotation/Annotation.hxx @@ -30,6 +30,7 @@ namespace sdr::annotation { class Annotation; +/** Type of the annotation / comment change. */ enum class CommentNotificationType { Add, @@ -37,10 +38,14 @@ enum class CommentNotificationType Remove }; +/** LOKit notify for a view */ SVXCORE_DLLPUBLIC void LOKCommentNotify(CommentNotificationType nType, const SfxViewShell* pViewShell, Annotation& rAnnotation); + +/** LOKit notify for all views */ SVXCORE_DLLPUBLIC void LOKCommentNotifyAll(CommentNotificationType nType, Annotation& rAnnotation); +/** Type of the annotation (that is supported) */ enum class AnnotationType { None, @@ -53,6 +58,7 @@ enum class AnnotationType FreeText, }; +/** Annotation data that is used at annotation creation */ struct CreationInfo { AnnotationType meType = AnnotationType::None; @@ -69,6 +75,7 @@ struct CreationInfo Color maColor = COL_TRANSPARENT; }; +/** Data of an annotation */ struct SVXCORE_DLLPUBLIC AnnotationData { css::geometry::RealPoint2D m_Position; @@ -82,6 +89,11 @@ struct SVXCORE_DLLPUBLIC AnnotationData void set(Annotation& rAnnotation); }; +/** Annotation object, responsible for handling of the annotation. + * + * Implements the XAnnotation UNO API, handles undo/redo and notifications () + * + **/ class SVXCORE_DLLPUBLIC Annotation : public ::comphelper::WeakComponentImplHelper, public ::cppu::PropertySetMixin @@ -121,6 +133,7 @@ public: comphelper::WeakComponentImplHelper::release(); } +// Changes without triggering notification broadcast css::geometry::RealPoint2D GetPosition() const { return m_Position; } void SetPosition(const css::geometry::RealPoint2D& rValue) { m_Position = rValue; } @@ -152,12 +165,14 @@ public: SdrPage const* getPage() const { return mpPage; } SdrPage* getPage() { return mpPage; } +// Unique ID of the annotation sal_uInt32 GetId() const { return m_nId; } CreationInfo const& getCreationInfo() { return maCreationInfo; } void setCreationInfo(CreationInfo const& rCreationInfo) { maCreationInfo = rCreationInfo; } }; +/** Vector of annotations */ typedef std::vector> AnnotationVector; } // namespace sdr::annotation diff --git a/include/svx/annotation/AnnotationObject.hxx b/include/svx/annotation/AnnotationObject.hxx index d46f4e7c3150..e372fec1f56a 100644 --- a/include/svx/annotation/AnnotationObject.hxx +++ b/include/svx/annotation/AnnotationObject.hxx @@ -16,12 +16,14 @@ namespace sdr::annotation { +/** Annotation data that contains the annotation unique ID and author's ID */ struct SVXCORE_DLLPUBLIC AnnotationViewData { sal_Int32 nIndex = -1; sal_uInt16 nAuthorIndex = 0; }; +/** Annotation (sdr) object, which represents an annotation inside the document */ class SVXCORE_DLLPUBLIC AnnotationObject final : public SdrRectObj { private: diff --git a/include/svx/annotation/ObjectAnnotationData.hxx b/include/svx/annotation/ObjectAnnotationData.hxx index 50a2f80c80ac..4530df2fb61c 100644 --- a/include/svx/annotation/ObjectAnnotationData.hxx +++ b/include/svx/annotation/ObjectAnnotationData.hxx @@ -15,14 +15,20 @@ namespace sdr::annotation { -/** Contains the annotation data for a SdrObject */ +/** Contains the annotation data specific for a SdrObject (which represents an annotation) */ class ObjectAnnotationData { public: +/// Does the (sdr) object represent an annotation bool mbIsAnnotation : 1 = false; + +/// The annotation rtl::Reference mxAnnotation; + +/// Object handling the pop-up window std::unique_ptr mpAnnotationPopup; +/// Open popup for the annotation void openPopup() { if (mbIsAnnotation && mpAnnotationPopup) diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index 2347a877fd7a..d6e68943e0ac 100644 ---
core.git: include/svx sd/source svx/source
include/svx/sdr/contact/viewcontact.hxx |5 + include/svx/sdr/contact/viewobjectcontact.hxx |5 + include/svx/svdedxv.hxx | 14 +++- sd/source/ui/view/sdview.cxx |6 + svx/source/sdr/contact/viewcontact.cxx| 23 ++ svx/source/sdr/contact/viewobjectcontact.cxx | 11 +++ svx/source/svdraw/svdedxv.cxx | 87 ++ svx/source/unodraw/unoshtxt.cxx |8 ++ 8 files changed, 157 insertions(+), 2 deletions(-) New commits: commit e3fdafaabc198054255fa7c5c34b6beed6915b3b Author: Armin Le Grand (allotropia) AuthorDate: Thu Feb 29 16:08:29 2024 +0100 Commit: Armin Le Grand CommitDate: Thu Feb 29 23:23:04 2024 +0100 IASS: Update edited Text in other Views This was not working for multiple Windows for a document, and also not supported for SlideShow until now. If you edit a Text on a Slide (Object, PresObj, ...) that text is not yet set at the Model until the TextEdit ends. In that situation those changes are now propagated to other views visualizing that object. This is done with slight slowdown to not do it all the time while typing, (currently 350ms, grepped from other places in the office). It will be shown in a running open SlideShow (and evtl. trigger an effect at the Object as Preview). This will allow to get a good preview for how it looks in the SlideShow. This is also done for further EditViews opened for that Document. This was not done before. It is fine-tuned to do this only for the Views besides the EditView with the running TextEdit to not cause slowdowns in that active view - the TextEdit is already running on the Overlay to have no problems with speed, this needs to be preserved. I had to fix a multi-view error in the a11y stack that implied that only one view exists and thus has to have an Outliner - that is wrong for multiple views, only one will have one. Change-Id: I781d32a8fcb8732ee8fcfbae72c02d1f99b6cd06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164160 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx index 7b6d0f3ab2c1..00b7f6253eae 100644 --- a/include/svx/sdr/contact/viewcontact.hxx +++ b/include/svx/sdr/contact/viewcontact.hxx @@ -27,6 +27,7 @@ class SdrLayerIDSet; class SdrPage; class SdrObject; +class SdrPageView; namespace sdr::contact { @@ -122,6 +123,10 @@ public: // React on changes of the object of this ViewContact virtual void ActionChanged(); +// IASS: helpers for IASS invalidates +void ActionChangedIfDifferentPageView(SdrPageView& rSdrPageView); +bool hasMultipleViewObjectContacts() const; + // access to the local primitive. This will ensure that the primitive is // current in comparing the local one with a fresh created incarnation void getViewIndependentPrimitive2DContainer( diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx b/include/svx/sdr/contact/viewobjectcontact.hxx index 12195a0faa34..8f903d93e04b 100644 --- a/include/svx/sdr/contact/viewobjectcontact.hxx +++ b/include/svx/sdr/contact/viewobjectcontact.hxx @@ -24,6 +24,8 @@ #include #include +class SdrPageView; + namespace vcl { class Region; } namespace sdr::animation { @@ -101,6 +103,9 @@ public: // React on changes of the object of this ViewContact virtual void ActionChanged(); +// IASS: helper for IASS invalidates +void ActionChangedIfDifferentPageView(SdrPageView& rSdrPageView); + // LazyInvalidate handling void triggerLazyInvalidate(); diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index 8ad7f048b682..6c6a37f108a7 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -76,8 +76,15 @@ class SVXCORE_DLLPUBLIC SdrObjEditView : public SdrGlueEditView, public EditView virtual void EditViewCursorRect(const tools::Rectangle& rRect, int nExtTextInputWidth) override; // The OverlayObjects used for visualizing active TextEdit (currently -// using TextEditOverlayObject, but not limited to it +// using TextEditOverlayObject, but not limited to it) sdr::overlay::OverlayObjectList maTEOverlayGroup; +Timer maTextEditUpdateTimer; + +// IASS: allow reaction to active TextEdit changes +DECL_DLLPRIVATE_LINK(ImpModifyHdl, LinkParamNone*, void); + +// IASS: timer-based reaction on TextEdit changes +DECL_DLLPRIVATE_LINK(TextEditUpdate, Timer*, void); protected: // TextEdit @@ -104,10 +111,15 @@ protected: bool mbTextEditNewObj : 1; // current edited object was just recreated bool mbQuickTextEditMode : 1; // persistent(->CrtV). Default=TRUE bool mbMacroDown : 1; +bool mbInteractiveSlideShow : 1; // IASS rtl::Refe
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/optgrid.hxx |2 + sd/source/ui/dlg/tpoption.cxx | 31 +--- svx/source/dialog/optgrid.cxx | 65 +++--- 3 files changed, 71 insertions(+), 27 deletions(-) New commits: commit 2bf8231ab5709f0d7577d6da53f50bc7f0b65079 Author: Balazs Varga AuthorDate: Tue Nov 28 11:57:29 2023 +0100 Commit: Balazs Varga CommitDate: Wed Nov 29 09:45:57 2023 +0100 tdf#158244 - UI: Part 45 - Unify lockdown behavior of Options dialog for Draw - Grid Page. Use the right grid settings associated with the application. follow-up of fbecf8009af8abdd218fbb3bd26087e8b805d06b Change-Id: I30b3c7ad80348a9cc89b6ea206a8ad9387276593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160020 Tested-by: Jenkins Reviewed-by: Balazs Varga diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx index b8e1f5604286..ed71e62cdb53 100644 --- a/include/svx/optgrid.hxx +++ b/include/svx/optgrid.hxx @@ -152,6 +152,8 @@ protected: std::unique_ptr m_xMtrFldBezAngle; std::unique_ptr m_xMtrFldBezAngleImg; +bool IsDrawMode() const { return m_Emode == DRAW_MODE; } + DECL_LINK(ClickRotateHdl_Impl, weld::Toggleable&, void); private: DECL_DLLPRIVATE_LINK(ChangeDrawHdl_Impl, weld::MetricSpinButton&, void); diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 8c5416c9cb09..812d39ffd8aa 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -83,51 +83,62 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs ) SdOptionsSnapItem aOptsItem( rAttrs->Get( ATTR_OPTIONS_SNAP ) ); -bool bReadOnly = officecfg::Office::Impress::Snap::Object::SnapLine::isReadOnly(); +bool bDrawMode = SvxGridTabPage::IsDrawMode(); +bool bReadOnly = bDrawMode ? officecfg::Office::Draw::Snap::Object::SnapLine::isReadOnly() : +officecfg::Office::Impress::Snap::Object::SnapLine::isReadOnly(); m_xCbxSnapHelplines->set_active( aOptsItem.GetOptionsSnap().IsSnapHelplines() ); m_xCbxSnapHelplines->set_sensitive(!bReadOnly); m_xCbxSnapHelplinesImg->set_visible(bReadOnly); -bReadOnly = officecfg::Office::Impress::Snap::Object::PageMargin::isReadOnly(); +bReadOnly = bDrawMode ? officecfg::Office::Draw::Snap::Object::PageMargin::isReadOnly() : +officecfg::Office::Impress::Snap::Object::PageMargin::isReadOnly(); m_xCbxSnapBorder->set_active( aOptsItem.GetOptionsSnap().IsSnapBorder() ); m_xCbxSnapBorder->set_sensitive(!bReadOnly); m_xCbxSnapBorderImg->set_visible(bReadOnly); -bReadOnly = officecfg::Office::Impress::Snap::Object::ObjectFrame::isReadOnly(); +bReadOnly = bDrawMode ? officecfg::Office::Draw::Snap::Object::ObjectFrame::isReadOnly() : +officecfg::Office::Impress::Snap::Object::ObjectFrame::isReadOnly(); m_xCbxSnapFrame->set_active( aOptsItem.GetOptionsSnap().IsSnapFrame() ); m_xCbxSnapFrame->set_sensitive(!bReadOnly); m_xCbxSnapFrameImg->set_visible(bReadOnly); -bReadOnly = officecfg::Office::Impress::Snap::Object::ObjectPoint::isReadOnly(); +bReadOnly = bDrawMode ? officecfg::Office::Draw::Snap::Object::ObjectPoint::isReadOnly() : +officecfg::Office::Impress::Snap::Object::ObjectPoint::isReadOnly(); m_xCbxSnapPoints->set_active( aOptsItem.GetOptionsSnap().IsSnapPoints() ); m_xCbxSnapPoints->set_sensitive(!bReadOnly); m_xCbxSnapPointsImg->set_visible(bReadOnly); -bReadOnly = officecfg::Office::Impress::Snap::Position::CreatingMoving::isReadOnly(); +bReadOnly = bDrawMode ? officecfg::Office::Draw::Snap::Position::CreatingMoving::isReadOnly() : + officecfg::Office::Impress::Snap::Position::CreatingMoving::isReadOnly(); m_xCbxOrtho->set_active( aOptsItem.GetOptionsSnap().IsOrtho() ); m_xCbxOrtho->set_sensitive(!bReadOnly); m_xCbxOrthoImg->set_visible(bReadOnly); -bReadOnly = officecfg::Office::Impress::Snap::Position::ExtendEdges::isReadOnly(); +bReadOnly = bDrawMode ? officecfg::Office::Draw::Snap::Position::ExtendEdges::isReadOnly() : +officecfg::Office::Impress::Snap::Position::ExtendEdges::isReadOnly(); m_xCbxBigOrtho->set_active( aOptsItem.GetOptionsSnap().IsBigOrtho() ); m_xCbxBigOrtho->set_sensitive(!bReadOnly); m_xCbxBigOrthoImg->set_visible(bReadOnly); -bReadOnly = officecfg::Office::Impress::Snap::Position::Rotating::isReadOnly(); +bReadOnly = bDrawMode ? officecfg::Office::Draw::Snap::Position::Rotating::isReadOnly() : +officecfg::Office::Impress::Snap::Position::Rotating::isReadOnly(); m_xCbxRotate->set_active( aOptsItem.GetOptionsSnap().IsRotate() ); m_xCbxRotate->set_sensitive(!bReadOnly); m_xCbxRotateImg->set_visible(bReadOnly); -bReadOnly = officecfg::Office::Impress::Snap::Object::Range::isReadOnly(); +bReadOnly = bDrawMode ? officecfg::Office::Draw::Snap::Object::Range::isReadOnly() : +o
[Libreoffice-commits] core.git: include/svx sd/source svx/source svx/uiconfig
include/svx/optgrid.hxx| 19 sd/source/ui/dlg/tpoption.cxx | 38 + svx/source/dialog/optgrid.cxx | 125 +++ svx/uiconfig/ui/optgridpage.ui | 162 + 4 files changed, 313 insertions(+), 31 deletions(-) New commits: commit fbecf8009af8abdd218fbb3bd26087e8b805d06b Author: Balazs Varga AuthorDate: Thu Nov 23 12:20:37 2023 +0100 Commit: Balazs Varga CommitDate: Fri Nov 24 15:16:43 2023 +0100 tdf#158239 - UI: Part 41 - Unify lockdown behavior of Options dialog for Impress - Grid Page. Change-Id: I0864a0a47a890c34154e775a1f960fdff09de81c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159868 Tested-by: Jenkins Reviewed-by: Balazs Varga diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx index c033d001871c..b8e1f5604286 100644 --- a/include/svx/optgrid.hxx +++ b/include/svx/optgrid.hxx @@ -104,8 +104,16 @@ public: virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; private: +enum ModuleMode +{ +WRITER_MODE = 0, +CALC_MODE = 1, +IMPRESS_MODE = 2, +DRAW_MODE = 3, +HTML_MODE = 4 +}; boolbAttrModified; -boolm_bHTMLMode; +ModuleMode m_Emode; std::unique_ptr m_xCbxUseGridsnap; std::unique_ptr m_xCbxUseGridsnapImg; @@ -125,15 +133,24 @@ protected: //these controls are used in draw and impress std::unique_ptr m_xSnapFrames; std::unique_ptr m_xCbxSnapHelplines; +std::unique_ptr m_xCbxSnapHelplinesImg; std::unique_ptr m_xCbxSnapBorder; +std::unique_ptr m_xCbxSnapBorderImg; std::unique_ptr m_xCbxSnapFrame; +std::unique_ptr m_xCbxSnapFrameImg; std::unique_ptr m_xCbxSnapPoints; +std::unique_ptr m_xCbxSnapPointsImg; std::unique_ptr m_xMtrFldSnapArea; +std::unique_ptr m_xMtrFldSnapAreaImg; std::unique_ptr m_xCbxOrtho; +std::unique_ptr m_xCbxOrthoImg; std::unique_ptr m_xCbxBigOrtho; +std::unique_ptr m_xCbxBigOrthoImg; std::unique_ptr m_xCbxRotate; +std::unique_ptr m_xCbxRotateImg; std::unique_ptr m_xMtrFldAngle; std::unique_ptr m_xMtrFldBezAngle; +std::unique_ptr m_xMtrFldBezAngleImg; DECL_LINK(ClickRotateHdl_Impl, weld::Toggleable&, void); private: diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index fabf76255bd7..300b5caedd71 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -82,16 +82,54 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs ) SdOptionsSnapItem aOptsItem( rAttrs->Get( ATTR_OPTIONS_SNAP ) ); +bool bReadOnly = officecfg::Office::Impress::Snap::Object::SnapLine::isReadOnly(); m_xCbxSnapHelplines->set_active( aOptsItem.GetOptionsSnap().IsSnapHelplines() ); +m_xCbxSnapHelplines->set_sensitive(!bReadOnly); +m_xCbxSnapHelplinesImg->set_visible(bReadOnly); + +bReadOnly = officecfg::Office::Impress::Snap::Object::PageMargin::isReadOnly(); m_xCbxSnapBorder->set_active( aOptsItem.GetOptionsSnap().IsSnapBorder() ); +m_xCbxSnapBorder->set_sensitive(!bReadOnly); +m_xCbxSnapBorderImg->set_visible(bReadOnly); + +bReadOnly = officecfg::Office::Impress::Snap::Object::ObjectFrame::isReadOnly(); m_xCbxSnapFrame->set_active( aOptsItem.GetOptionsSnap().IsSnapFrame() ); +m_xCbxSnapFrame->set_sensitive(!bReadOnly); +m_xCbxSnapFrameImg->set_visible(bReadOnly); + +bReadOnly = officecfg::Office::Impress::Snap::Object::ObjectPoint::isReadOnly(); m_xCbxSnapPoints->set_active( aOptsItem.GetOptionsSnap().IsSnapPoints() ); +m_xCbxSnapPoints->set_sensitive(!bReadOnly); +m_xCbxSnapPointsImg->set_visible(bReadOnly); + +bReadOnly = officecfg::Office::Impress::Snap::Position::CreatingMoving::isReadOnly(); m_xCbxOrtho->set_active( aOptsItem.GetOptionsSnap().IsOrtho() ); +m_xCbxOrtho->set_sensitive(!bReadOnly); +m_xCbxOrthoImg->set_visible(bReadOnly); + +bReadOnly = officecfg::Office::Impress::Snap::Position::ExtendEdges::isReadOnly(); m_xCbxBigOrtho->set_active( aOptsItem.GetOptionsSnap().IsBigOrtho() ); +m_xCbxBigOrtho->set_sensitive(!bReadOnly); +m_xCbxBigOrthoImg->set_visible(bReadOnly); + +bReadOnly = officecfg::Office::Impress::Snap::Position::Rotating::isReadOnly(); m_xCbxRotate->set_active( aOptsItem.GetOptionsSnap().IsRotate() ); +m_xCbxRotate->set_sensitive(!bReadOnly); +m_xCbxRotateImg->set_visible(bReadOnly); + +bReadOnly = officecfg::Office::Impress::Snap::Object::Range::isReadOnly(); m_xMtrFldSnapArea->set_value(aOptsItem.GetOptionsSnap().GetSnapArea(), FieldUnit::PIXEL); +m_xMtrFldSnapArea->set_sensitive(!bReadOnly); +m_xMtrFldSnapAreaImg->set_visible(bReadOnly); + +bReadOnly = officecfg::Office::Impress::Snap::Position::RotatingValue::isReadOnly(); m_xMtrFldAngle->set_value(aOptsItem.GetOptionsSnap().GetAngle().
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdoedge.hxx | 30 ++--- sd/source/ui/func/fupoor.cxx |4 sd/source/ui/view/sdview3.cxx |4 svx/source/svdraw/svdcrtv.cxx |2 svx/source/svdraw/svdoedge.cxx | 208 - 5 files changed, 124 insertions(+), 124 deletions(-) New commits: commit 01d7bd4f08cf05dd44b1239287451c52a965e343 Author: Julien Nabet AuthorDate: Mon Sep 11 23:45:58 2023 +0200 Commit: Julien Nabet CommitDate: Tue Sep 12 07:43:40 2023 +0200 svx: prefix members of SdrObjConnection + modify GetObject() into GetSdrObject() + modify pObj into m_pSdrObj The goal was to be a little bit more specific since they concern a class and not a local function. Change-Id: I1b3f19a16a452f22af82da22e33cd2f1522e1a7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156832 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx index faa8c67b1e65..4da2219b3645 100644 --- a/include/svx/svdoedge.hxx +++ b/include/svx/svdoedge.hxx @@ -42,14 +42,14 @@ class SdrObjConnection final friend classImpEdgeHdl; friend classSdrCreateView; -Point aObjOfs; // set during dragging of a node -SdrObject* pObj; // referenced object -sal_uInt16 nConId;// connector number +Point m_aObjOfs; // set during dragging of a node +SdrObject* m_pSdrObj; // referenced object +sal_uInt16 m_nConId;// connector number -boolbBestConn : 1; // true -> the best-matching connector is searched for -boolbBestVertex : 1; // true -> the best-matching vertex to connect is searched for -boolbAutoVertex : 1; // autoConnector at apex nCon -boolbAutoCorner : 1; // autoConnector at corner nCon +boolm_bBestConn : 1; // true -> the best-matching connector is searched for +boolm_bBestVertex : 1; // true -> the best-matching vertex to connect is searched for +boolm_bAutoVertex : 1; // autoConnector at apex nCon +boolm_bAutoCorner : 1; // autoConnector at corner nCon public: SdrObjConnection() { ResetVars(); } @@ -57,15 +57,15 @@ public: void ResetVars(); bool TakeGluePoint(SdrGluePoint& rGP) const; -void SetBestConnection( bool rB ) { bBestConn = rB; }; -void SetBestVertex( bool rB ) { bBestVertex = rB; }; -void SetAutoVertex( bool rB ) { bAutoVertex = rB; }; -void SetConnectorId( sal_uInt16 nId ) { nConId = nId; }; +void SetBestConnection( bool rB ) { m_bBestConn = rB; }; +void SetBestVertex( bool rB ) { m_bBestVertex = rB; }; +void SetAutoVertex( bool rB ) { m_bAutoVertex = rB; }; +void SetConnectorId( sal_uInt16 nId ) { m_nConId = nId; }; -bool IsBestConnection() const { return bBestConn; }; -bool IsAutoVertex() const { return bAutoVertex; }; -sal_uInt16 GetConnectorId() const { return nConId; }; -SdrObject* GetObject() const { return pObj; } +bool IsBestConnection() const { return m_bBestConn; }; +bool IsAutoVertex() const { return m_bAutoVertex; }; +sal_uInt16 GetConnectorId() const { return m_nConId; }; +SdrObject* GetSdrObject() const { return m_pSdrObj; } }; diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index c75959fbc243..e6fe25f7117d 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -607,14 +607,14 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { if(0 == pHdl->GetPointNum()) { -if(pEdgeObj->GetConnection(true).GetObject()) +if(pEdgeObj->GetConnection(true).GetSdrObject()) { bIsMoveOfConnectedHandle = true; } } if(1 == pHdl->GetPointNum()) { -if(pEdgeObj->GetConnection(false).GetObject()) +if(pEdgeObj->GetConnection(false).GetSdrObject()) { bIsMoveOfConnectedHandle = true; } diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index ac95db930629..c0fa51d1ae67 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -533,7 +533,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // test first connection SdrObjConnection&
[Libreoffice-commits] core.git: include/svx sd/source svx/source sw/source
include/svx/svdhdl.hxx | 66 sd/source/ui/animations/motionpathtag.cxx |4 sd/source/ui/annotations/annotationtag.cxx |6 sd/source/ui/view/viewoverlaymanager.cxx | 14 - svx/source/diagram/IDiagramHelper.cxx |2 svx/source/svdraw/svdhdl.cxx | 222 ++--- svx/source/table/tablehandles.cxx | 10 - sw/source/core/draw/dview.cxx |2 8 files changed, 163 insertions(+), 163 deletions(-) New commits: commit c8c42754ca8adf2b909261fde01fb3dbad8d50c0 Author: Miklos Vajna AuthorDate: Mon Sep 11 08:18:38 2023 +0200 Commit: Miklos Vajna CommitDate: Mon Sep 11 09:44:38 2023 +0200 svx: prefix members of SdrHdl See tdf#94879 for motivation. Change-Id: Icd2be0663b7b498bb06f09ced97673244e328a9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156809 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx index 61c0100ad144..78bb95e25ab2 100644 --- a/include/svx/svdhdl.hxx +++ b/include/svx/svdhdl.hxx @@ -133,25 +133,25 @@ class SVXCORE_DLLPUBLIC SdrHdl friend classSdrHdlList; protected: -SdrObject* pObj; // does handle belong to an object? -SdrPageView*pPV; // does handle belong to an object in certain pageview? -SdrHdlList* pHdlList; // to store the handlesize +SdrObject* m_pObj; // does handle belong to an object? +SdrPageView*m_pPV; // does handle belong to an object in certain pageview? +SdrHdlList* m_pHdlList; // to store the handlesize // OVERLAYMANAGER sdr::overlay::OverlayObjectList maOverlayGroup; -Point aPos; +Point m_aPos; -SdrHdlKind eKind; +SdrHdlKind m_eKind; -Degree100 nRotationAngle; // turn handle or mousepointer -sal_uInt32 nObjHdlNum; // required by MarkView -sal_uInt32 nPolyNum; // Polygonpoint -sal_uInt32 nPPntNum; // Point number of the polygon -sal_uInt32 nSourceHdlNum; // still to implement +Degree100 m_nRotationAngle; // turn handle or mousepointer +sal_uInt32 m_nObjHdlNum; // required by MarkView +sal_uInt32 m_nPolyNum; // Polygonpoint +sal_uInt32 m_nPPntNum; // Point number of the polygon +sal_uInt32 m_nSourceHdlNum; // still to implement -boolbSelect : 1;// is a polygon point selected? -boolb1PixMore : 1; // True=handle is shown 1 pixel larger -boolbPlusHdl : 1; // for Hld-Paint optimisation at MarkPoint/UnmarkPoint, and other ... +boolm_bSelect : 1;// is a polygon point selected? +boolm_b1PixMore : 1; // True=handle is shown 1 pixel larger +boolm_bPlusHdl : 1; // for Hld-Paint optimisation at MarkPoint/UnmarkPoint, and other ... boolmbMoveOutside; // forces this handle to be moved outside of the selection rectangle @@ -191,41 +191,41 @@ public: const sdr::overlay::OverlayObjectList& getOverlayObjectList() const { return maOverlayGroup; } void SetHdlList(SdrHdlList* pList); -SdrHdlKind GetKind() const { return eKind; } +SdrHdlKind GetKind() const { return m_eKind; } void Touch(); -const Point& GetPos() const { return aPos; } +const Point& GetPos() const { return m_aPos; } void SetPos(const Point& rPnt); -SdrPageView* GetPageView() const { return pPV; } -void SetPageView(SdrPageView* pNewPV) { pPV=pNewPV; } +SdrPageView* GetPageView() const { return m_pPV; } +void SetPageView(SdrPageView* pNewPV) { m_pPV=pNewPV; } -SdrObject* GetObj() const { return pObj; } +SdrObject* GetObj() const { return m_pObj; } void SetObj(SdrObject* pNewObj); -bool IsSelected() const { return bSelect; } +bool IsSelected() const { return m_bSelect; } void SetSelected(bool bJa=true); void Set1PixMore(bool bJa=true); void SetRotationAngle(Degree100 n); -bool IsCornerHdl() const { return eKind==SdrHdlKind::UpperLeft || eKind==SdrHdlKind::UpperRight || eKind==SdrHdlKind::LowerLeft || eKind==SdrHdlKind::LowerRight; } -bool IsVertexHdl() const { return eKind==SdrHdlKind::Upper || eKind==SdrHdlKind::Lower || eKind==SdrHdlKind::Left || eKind==SdrHdlKind::Right; } +bool IsCornerHdl() const { return m_eKind==SdrHdlKind::UpperLeft || m_eKind==SdrHdlKind::UpperRight || m_eKind==SdrHdlKind::LowerLeft || m_eKind==SdrHdlKind::LowerRight; } +
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/unopool.hxx | 13 ++--- sd/source/ui/unoidl/unopool.cxx |2 +- svx/source/unodraw/unopool.cxx | 10 ++ 3 files changed, 9 insertions(+), 16 deletions(-) New commits: commit 7bc010d624215b3d1830546e5c6f0a24567c54f4 Author: Noel Grandin AuthorDate: Thu Sep 7 08:41:17 2023 +0200 Commit: Noel Grandin CommitDate: Thu Sep 7 13:37:23 2023 +0200 SvxUnoDrawPool does not need to implement XAggreggation Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference const &) final { assert(false); } + Change-Id: I50283dff8832557ffaa9074532a2245210dc6d7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156633 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/unopool.hxx b/include/svx/unopool.hxx index 9e86c957a27f..331a8e4ae67e 100644 --- a/include/svx/unopool.hxx +++ b/include/svx/unopool.hxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -36,9 +36,9 @@ class SfxItemPool; The class can work in a read only mode without a model. Derivated classes can set a model on demand by overriding getModelPool(). */ -class SVX_DLLPUBLIC SvxUnoDrawPool :public ::cppu::OWeakAggObject, -public css::lang::XServiceInfo, -public css::lang::XTypeProvider, +typedef ::comphelper::WeakComponentImplHelper SvxUnoDrawPool_Base; + +class SVX_DLLPUBLIC SvxUnoDrawPool : public SvxUnoDrawPool_Base, public comphelper::PropertySetHelper { public: @@ -60,12 +60,11 @@ public: virtual css::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry ) override; // XInterface -virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; virtual void SAL_CALL acquire() noexcept override -{ OWeakAggObject::acquire(); } +{ OWeakObject::acquire(); } virtual void SAL_CALL release() noexcept override -{ OWeakAggObject::release(); } +{ OWeakObject::release(); } // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; diff --git a/sd/source/ui/unoidl/unopool.cxx b/sd/source/ui/unoidl/unopool.cxx index 5791aa6984ed..6a4124bcfe62 100644 --- a/sd/source/ui/unoidl/unopool.cxx +++ b/sd/source/ui/unoidl/unopool.cxx @@ -83,7 +83,7 @@ void SdUnoDrawPool::putAny( SfxItemPool* pPool, const comphelper::PropertyMapEnt uno::Reference< uno::XInterface > SdUnoCreatePool( SdDrawDocument* pDrawModel ) { -return static_cast(new SdUnoDrawPool( pDrawModel )); +return static_cast(new SdUnoDrawPool( pDrawModel )); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx index eb897556eff9..5dc577a3e87b 100644 --- a/svx/source/unodraw/unopool.cxx +++ b/svx/source/unodraw/unopool.cxx @@ -40,7 +40,7 @@ using namespace ::com::sun::star; using namespace ::cppu; SvxUnoDrawPool::SvxUnoDrawPool(SdrModel* pModel, rtl::Reference const & xDefaults) -: PropertySetHelper( xDefaults ), mpModel( pModel ) +: SvxUnoDrawPool_Base(), PropertySetHelper( xDefaults ), mpModel( pModel ) { init(); } @@ -307,11 +307,6 @@ uno::Any SvxUnoDrawPool::_getPropertyDefault( const comphelper::PropertyMapEntry // XInterface uno::Any SAL_CALL SvxUnoDrawPool::queryInterface( const uno::Type & rType ) -{ -return OWeakAggObject::queryInterface( rType ); -} - -uno::Any SAL_CALL SvxUnoDrawPool::queryAggregation( const uno::Type & rType ) { uno::Any aAny; @@ -326,7 +321,7 @@ uno::Any SAL_CALL SvxUnoDrawPool::queryAggregation( const uno::Type & rType ) else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< beans::XMultiPropertySet >(this); else -aAny = OWeakAggObject::queryAggregation( rType ); +aAny = OWeakObject::queryInterface( rType ); return aAny; } @@ -334,7 +329,6 @@ uno::Any SAL_CALL SvxUnoDrawPool::queryAggregation( const uno::Type & rType ) uno::Sequence< uno::Type > SAL_CALL SvxUnoDrawPool::getTypes() { static const uno::Sequence aTypes { -cppu::UnoType::get(), cppu::UnoType::get(), cppu::UnoType::get(), cppu::UnoType::get(),
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdetc.hxx |2 sd/source/ui/table/TableDesignPane.cxx |3 - svx/source/svdraw/svdetc.cxx| 78 +++- svx/source/svdraw/svdotextdecomposition.cxx |3 - svx/source/svdraw/svdpage.cxx |3 - 5 files changed, 37 insertions(+), 52 deletions(-) New commits: commit 7d7b2747751c442b7c75680d9960de70037e38d8 Author: Mike Kaganski AuthorDate: Fri Aug 25 10:03:21 2023 +0300 Commit: Mike Kaganski CommitDate: Fri Aug 25 13:40:37 2023 +0200 Use std::optional instead of out arguments Change-Id: I6dde7d602695d44488f7debf65d8ef278fa8704c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156087 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx index 9ae29efb5f06..61c8a34867cf 100644 --- a/include/svx/svdetc.hxx +++ b/include/svx/svdetc.hxx @@ -87,7 +87,7 @@ class SfxItemSet; * * @returns false for XFILL_NONE and rCol remains unchanged */ -SVXCORE_DLLPUBLIC bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol); +SVXCORE_DLLPUBLIC std::optional GetDraftFillColor(const SfxItemSet& rSet); /** diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index 5d4d50e3d68a..7c5154a0e1db 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -757,8 +757,7 @@ CellInfo::CellInfo( const Reference< XStyle >& xStyle ) SfxItemSet& rSet = pStyleSheet->GetItemSet(); // get style fill color -if( !GetDraftFillColor(rSet, maCellColor) ) -maCellColor = COL_TRANSPARENT; +maCellColor = GetDraftFillColor(rSet).value_or(COL_TRANSPARENT); // get style text color const SvxColorItem* pTextColor = rSet.GetItem(EE_CHAR_COLOR); diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index feb879f27c5d..15e638e445cf 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -237,19 +237,15 @@ bool OLEObjCache::UnloadObj(SdrOle2Obj& rObj) return bUnloaded; } -bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol) +std::optional GetDraftFillColor(const SfxItemSet& rSet) { drawing::FillStyle eFill=rSet.Get(XATTR_FILLSTYLE).GetValue(); -bool bRetval = false; switch(eFill) { case drawing::FillStyle_SOLID: { -rCol = rSet.Get(XATTR_FILLCOLOR).GetColorValue(); -bRetval = true; - -break; +return rSet.Get(XATTR_FILLCOLOR).GetColorValue(); } case drawing::FillStyle_HATCH: { @@ -264,20 +260,14 @@ bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol) } const basegfx::BColor aAverageColor(basegfx::average(aCol1.getBColor(), aCol2.getBColor())); -rCol = Color(aAverageColor); -bRetval = true; - -break; +return Color(aAverageColor); } case drawing::FillStyle_GRADIENT: { const basegfx::BGradient& rGrad=rSet.Get(XATTR_FILLGRADIENT).GetGradientValue(); Color aCol1(Color(rGrad.GetColorStops().front().getStopColor())); Color aCol2(Color(rGrad.GetColorStops().back().getStopColor())); const basegfx::BColor aAverageColor(basegfx::average(aCol1.getBColor(), aCol2.getBColor())); -rCol = Color(aAverageColor); -bRetval = true; - -break; +return Color(aAverageColor); } case drawing::FillStyle_BITMAP: { @@ -286,7 +276,7 @@ bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol) const sal_uInt32 nWidth = aSize.Width(); const sal_uInt32 nHeight = aSize.Height(); if (nWidth <= 0 || nHeight <= 0) -return bRetval; +return {}; Bitmap::ScopedReadAccess pAccess(aBitmap); @@ -317,16 +307,14 @@ bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol) nGn /= nCount; nBl /= nCount; -rCol = Color(sal_uInt8(nRt), sal_uInt8(nGn), sal_uInt8(nBl)); - -bRetval = true; +return Color(sal_uInt8(nRt), sal_uInt8(nGn), sal_uInt8(nBl)); } break; } default: break; } -return bRetval; +return {}; } std::unique_ptr SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel& rModel) @@ -473,17 +461,15 @@ void SvdProgressInfo::SetNextObject() namespace { -bool impGetSdrObjListFillColor( +std::optional impGetSdrObjListFillColor( const SdrObjList& rList, const Point& rPnt, const SdrPageView& rTextEditPV, -const SdrLayerIDSet& rVisLayers, -Color& rCol) +const SdrLayerIDSet& rVisLayers) { -bool bRet(false); bool bMaster(rList.getSdrPageFromSdrObjList() && rList.getSdrPageFro
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/constructhelper.hxx |6 ++ sd/source/ui/func/fuconrec.cxx| 31 --- svx/source/svdraw/constructhelper.cxx |9 + 3 files changed, 15 insertions(+), 31 deletions(-) New commits: commit a780c820f5cf3bfbb5d88bd5c6ca670e0a0c730f Author: Dr. David Alan Gilbert AuthorDate: Sat Jul 1 14:34:19 2023 +0100 Commit: Caolán McNamara CommitDate: Mon Jul 3 22:21:18 2023 +0200 tdf#155630 Use common getPolygon for sd Unfortunately the SetLineEnds in sw is different enough from sw and sc to make sharing it a pain. However we can share the GetPolygon function we already moved into svx. Expose the svx function into the header and use it in sd. Change-Id: I05b0f820286c8ce848fa0d6c69603d3625c2b4d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153828 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/svx/constructhelper.hxx b/include/svx/constructhelper.hxx index 449a7ba7d1d0..928e6b1d3c68 100644 --- a/include/svx/constructhelper.hxx +++ b/include/svx/constructhelper.hxx @@ -19,15 +19,21 @@ #pragma once +#include #include #include +#include +class SdrModel; class SdrObject; class SfxItemSet; class SVXCORE_DLLPUBLIC ConstructHelper { public: +// Helper to find the shape for a given line end +static ::basegfx::B2DPolyPolygon GetLineEndPoly(TranslateId pResId, const SdrModel& rModel); + // set line starts and ends for newly created objects static void SetLineEnds(SfxItemSet& rAttr, const SdrObject& rObj, sal_uInt16 nSlotId, tools::Long nWidth); diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index a1f4e5f3c6cf..3561a6eb8c47 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -666,30 +667,6 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj) /** * set line starts and ends for the object to be created */ -static ::basegfx::B2DPolyPolygon getPolygon(TranslateId pResId, const SdrModel& rModel) -{ -::basegfx::B2DPolyPolygon aRetval; -XLineEndListRef pLineEndList(rModel.GetLineEndList()); - -if( pLineEndList.is() ) -{ -OUString aArrowName(SvxResId(pResId)); -::tools::Long nCount = pLineEndList->Count(); -::tools::Long nIndex; -for( nIndex = 0; nIndex < nCount; nIndex++ ) -{ -const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex); -if( pEntry->GetName() == aArrowName ) -{ -aRetval = pEntry->GetLineEnd(); -break; -} -} -} - -return aRetval; -} - void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj) { if ( !((rObj.GetObjIdentifier() == SdrObjKind::Edge && @@ -710,7 +687,7 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj SdrModel& rModel(rObj.getSdrModelFromSdrObject()); // arrowhead -::basegfx::B2DPolyPolygon aArrow( getPolygon( RID_SVXSTR_ARROW, rModel ) ); +::basegfx::B2DPolyPolygon aArrow(ConstructHelper::GetLineEndPoly(RID_SVXSTR_ARROW, rModel)); if( !aArrow.count() ) { ::basegfx::B2DPolygon aNewArrow; @@ -722,7 +699,7 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj } // Circles -::basegfx::B2DPolyPolygon aCircle( getPolygon( RID_SVXSTR_CIRCLE, rModel ) ); +::basegfx::B2DPolyPolygon aCircle(ConstructHelper::GetLineEndPoly(RID_SVXSTR_CIRCLE, rModel)); if( !aCircle.count() ) { ::basegfx::B2DPolygon aNewCircle = ::basegfx::utils::createPolygonFromEllipse(::basegfx::B2DPoint(0.0, 0.0), 250.0, 250.0); @@ -731,7 +708,7 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj } // Square -::basegfx::B2DPolyPolygon aSquare( getPolygon( RID_SVXSTR_SQUARE, rModel ) ); +::basegfx::B2DPolyPolygon aSquare(ConstructHelper::GetLineEndPoly(RID_SVXSTR_SQUARE, rModel)); if( !aSquare.count() ) { ::basegfx::B2DPolygon aNewSquare; diff --git a/svx/source/svdraw/constructhelper.cxx b/svx/source/svdraw/constructhelper.cxx index f09d11787809..d7c7f20a5cc8 100644 --- a/svx/source/svdraw/constructhelper.cxx +++ b/svx/source/svdraw/constructhelper.cxx @@ -34,7 +34,8 @@ //using namespace ::com::sun::star; -static ::basegfx::B2DPolyPolygon lcl_getPolygon(TranslateId pResId, const SdrModel& rModel) +::basegfx::B2DPolyPolygon ConstructHelper::GetLineEndPoly(TranslateId pResId, + const SdrModel& rModel) { ::basegfx::B2DPolyPolygon aRetval; XLineEndListRef pLineEndList(rModel.GetLineEndList()); @@ -72,7 +73,7 @@ void ConstructHelper::SetLineEnds(SfxItemSet& rAttr, const SdrObj
[Libreoffice-commits] core.git: include/svx sd/source svx/source sw/qa sw/source
include/svx/ColorSets.hxx | 12 +- include/svx/dialog/ThemeDialog.hxx |4 +-- include/svx/svdmodel.hxx |4 +-- include/svx/svdpage.hxx|2 - sd/source/filter/eppt/pptx-epptooxml.cxx |2 - sd/source/ui/docshell/docshell.cxx |4 +-- sd/source/ui/func/fuconstr.cxx |2 - sd/source/ui/func/fupage.cxx |2 - sd/source/ui/unoidl/unomodel.cxx |4 +-- sd/source/ui/unoidl/unopage.cxx|4 +-- svx/source/dialog/ThemeDialog.cxx | 19 ++-- svx/source/styles/ColorSets.cxx| 34 ++--- svx/source/svdraw/svdmodel.cxx | 24 ++-- svx/source/svdraw/svdpage.cxx | 25 + sw/qa/core/theme/ThemeTest.cxx |4 +-- sw/source/core/model/ThemeColorChanger.cxx |4 +-- sw/source/core/unocore/unodraw.cxx |2 - sw/source/filter/xml/xmlfmte.cxx |2 - sw/source/uibase/app/docst.cxx |2 - sw/source/uibase/shells/basesh.cxx |6 ++--- sw/source/uibase/sidebar/ThemePanel.cxx| 22 -- sw/source/uibase/sidebar/ThemePanel.hxx|2 - 22 files changed, 116 insertions(+), 70 deletions(-) New commits: commit 4a7a89b97b0b6464f8375926d98044634d06b4ee Author: Tomaž Vajngerl AuthorDate: Tue Feb 7 16:13:27 2023 +0900 Commit: Tomaž Vajngerl CommitDate: Wed Mar 1 00:29:23 2023 + create a default theme when SdrPage and SdrModel are created For a document it is expected that it always has a theme available so we need to create a theme with some default attributes set (a default color scheme for now) when we create a SdrModel and SdrPage (only for Writer currently). This also changes some ColorSets, SdrPage, SdrModel methods, to use better return types (cost& instead of raw pointers and vice versa depending on the use case). Change-Id: I874247784b845109e42567e3f45647dda46ccf3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146816 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx index faec6d2c2249..cb096dab0e87 100644 --- a/include/svx/ColorSets.hxx +++ b/include/svx/ColorSets.hxx @@ -15,19 +15,21 @@ #include #include #include +#include namespace svx { class SVXCORE_DLLPUBLIC ColorSets { +private: std::vector maColorSets; -public: ColorSets(); -~ColorSets(); - void init(); -const std::vector& getColorSets() const +public: +static ColorSets& get(); + +const std::vector& getColorSetVector() const { return maColorSets; } @@ -37,7 +39,7 @@ public: return maColorSets[nIndex]; } -const model::ColorSet& getColorSet(std::u16string_view rName); +model::ColorSet const* getColorSet(std::u16string_view rName) const; void insert(model::ColorSet const& rColorSet); }; diff --git a/include/svx/dialog/ThemeDialog.hxx b/include/svx/dialog/ThemeDialog.hxx index 1db4f2f43e6a..5d3fdc70f250 100644 --- a/include/svx/dialog/ThemeDialog.hxx +++ b/include/svx/dialog/ThemeDialog.hxx @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -23,7 +22,8 @@ class SVX_DLLPUBLIC ThemeDialog final : public weld::GenericDialogController { private: model::Theme* mpTheme; -svx::ColorSets maColorSets; +std::vector maColorSets; + std::shared_ptr mpChanger; std::unique_ptr mxValueSetThemeColors; diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 63cc3bc1fb79..fe216d569919 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -538,8 +538,8 @@ public: SfxStyleSheetBasePool* GetStyleSheetPool() const { return mxStyleSheetPool.get(); } void SetStyleSheetPool(SfxStyleSheetBasePool* pPool) { mxStyleSheetPool=pPool; } -void SetTheme(std::unique_ptr pTheme); -model::Theme* GetTheme(); +void setTheme(std::unique_ptr pTheme); +std::unique_ptr const& getTheme() const; voidSetStarDrawPreviewMode(bool bPreview); boolIsStarDrawPreviewMode() const { return m_bStarDrawPreviewMode; } diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index 186a49a028f8..fde15ccedcd9 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -347,7 +347,7 @@ public: SfxStyleSheet* GetStyleSheet() const { return mpStyleSheet;} void SetTheme(std::unique_ptr pTheme); -model::Theme* GetTheme(); +std::unique_ptr const& GetTheme() const; void dumpAsXml(xmlTextWriterPtr pWriter) const; }; diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 16208f48fb79..1ae7da9cc786 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/ppt
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdobj.hxx |3 ++- sd/source/ui/view/sdview.cxx| 24 svx/source/svdraw/svdotextdecomposition.cxx |4 +++- 3 files changed, 25 insertions(+), 6 deletions(-) New commits: commit 000a05339b4d7d25aea063a16b7a01ca9080978f Author: Caolán McNamara AuthorDate: Tue Nov 8 11:33:38 2022 + Commit: Caolán McNamara CommitDate: Tue Nov 8 14:52:43 2022 +0100 Resolves: tdf#148140 get text auto color right in impress edit mode Change-Id: I2695c86e9b749a4c38920af6d33e8e89f8ea3c62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142426 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index a251d8ddac33..3c30c479dc80 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -880,7 +880,8 @@ public: const css::uno::WeakReference< css::drawing::XShape >& getWeakUnoShape() const { return maWeakUnoShape; } -void setSuitableOutlinerBg(Outliner& rOutliner) const; +// return true if a bg was set, false otherwise +bool setSuitableOutlinerBg(Outliner& rOutliner) const; // If fillstyle is drawing::FillStyle_BITMAP, returns the graphic. const Graphic* getFillGraphic() const; diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index c92ee1113e3c..3c5d190532fe 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -449,6 +449,20 @@ void ViewRedirector::createRedirectedPrimitive2DSequence( } } +namespace +{ +void setOutlinerBgFromPage(::Outliner& rOutl, SdrPageView& rPgView, bool bScreenDisplay) +{ +SdPage* pPage = static_cast(rPgView.GetPage()); +if (pPage) +{ +// #i75566# Name change GetBackgroundColor -> GetPageBackgroundColor and +// hint value if screen display. Only then the AutoColor mechanisms shall be applied +rOutl.SetBackgroundColor(pPage->GetPageBackgroundColor(&rPgView, bScreenDisplay)); +} +} +} + /** * The event will be forwarded to the View */ @@ -476,9 +490,7 @@ void View::CompleteRedraw(OutputDevice* pOutDev, const vcl::Region& rReg, sdr::c || (OUTDEV_PDF == pOutDev->GetOutDevType( bScreenDisplay = false; -// #i75566# Name change GetBackgroundColor -> GetPageBackgroundColor and -// hint value if screen display. Only then the AutoColor mechanisms shall be applied -rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pPgView, bScreenDisplay) ); +setOutlinerBgFromPage(rOutl, *pPgView, bScreenDisplay); } } @@ -724,7 +736,11 @@ bool View::SdrBeginTextEdit( } else { -pObj->setSuitableOutlinerBg(*pOL); +// tdf#148140 Set the background to determine autocolor. +// Use any explicit bg with fallback to underlying page if +// none found +if (!pObj->setSuitableOutlinerBg(*pOL) && pPV) +setOutlinerBgFromPage(*pOL, *pPV, true); } } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 5d7389fe83db..e526c44edc68 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -875,7 +875,7 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive( // Resolves: fdo#35779 set background color of this shape as the editeng background if there // is one. Check the shape itself, then the host page, then that page's master page. -void SdrObject::setSuitableOutlinerBg(::Outliner& rOutliner) const +bool SdrObject::setSuitableOutlinerBg(::Outliner& rOutliner) const { const SfxItemSet* pBackgroundFillSet = getBackgroundFillSet(); if (drawing::FillStyle_NONE != pBackgroundFillSet->Get(XATTR_FILLSTYLE).GetValue()) @@ -883,7 +883,9 @@ void SdrObject::setSuitableOutlinerBg(::Outliner& rOutliner) const Color aColor(rOutliner.GetBackgroundColor()); GetDraftFillColor(*pBackgroundFillSet, aColor); rOutliner.SetBackgroundColor(aColor); +return true; } +return false; } const SfxItemSet* SdrObject::getBackgroundFillSet() const
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/diagram/IDiagramHelper.hxx | 19 + include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx |1 sd/source/ui/func/fusel.cxx | 26 + svx/source/diagram/IDiagramHelper.cxx| 360 --- 4 files changed, 359 insertions(+), 47 deletions(-) New commits: commit 391cb44d415e2126f668ecf62387d5e98ffa6f5c Author: Armin Le Grand (Allotropia) AuthorDate: Tue May 31 11:48:32 2022 +0200 Commit: Armin Le Grand CommitDate: Tue May 31 18:39:24 2022 +0200 Advanced Diagram support: UI visualization & simple interactions Added visualization to show an imminently recognizable additional visualization for DynamicDiagrams that can also be used to show/hide the DiagramDialog by the user. It is also used as additional drag/move handle for the object. Change-Id: I56292cebe7c7a6f79be920c17edafdd7e453b6eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135183 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/include/svx/diagram/IDiagramHelper.hxx b/include/svx/diagram/IDiagramHelper.hxx index c0bf0539050d..e93056f70049 100644 --- a/include/svx/diagram/IDiagramHelper.hxx +++ b/include/svx/diagram/IDiagramHelper.hxx @@ -22,6 +22,7 @@ #include #include #include +#include // Forward declarations class SdrObjGroup; @@ -29,6 +30,24 @@ class SdrHdlList; namespace svx { namespace diagram { +// Helper class to visualize an imminently recognizable +// additional visualization for DynamicDiagrams that can also +// be used to show/hide the DiagramDialog by the user +// Note: is also used as additional drag/move handle +class SVXCORE_DLLPUBLIC DiagramFrameHdl final : public SdrHdl +{ +// object dimensions +basegfx::B2DHomMatrix maTransformation; + +// create marker for this kind +virtual void CreateB2dIAObject() override; + +public: +DiagramFrameHdl(const basegfx::B2DHomMatrix& rTransformation); + +static void clicked(const Point& rPnt); +}; + class DiagramDataState; // Helper class to allow administer advanced Diagram related diff --git a/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx b/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx index d6cb948a6bf6..0af20f04d710 100644 --- a/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx +++ b/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx @@ -48,6 +48,7 @@ #define PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 22) #define PRIMITIVE2D_ID_SDRCHAINEDTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 23) #define PRIMITIVE2D_ID_SDRFRAMEBORDERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 24) +#define PRIMITIVE2D_ID_OVERLAYDIAGRAMPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 25) #endif // INCLUDED_SVX_SDR_PRIMITIVE2D_SVX_PRIMITIVETYPES2D_HXX diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 5b5e37ab5779..bd82a7a97da0 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -55,6 +55,7 @@ #include #include +#include #include #include @@ -674,7 +675,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) } mpView->SetDragWithCopy(bDragWithCopy); -mpView->EndDragObj( mpView->IsDragWithCopy() ); +bool bWasDragged(mpView->EndDragObj( mpView->IsDragWithCopy() )); mpView->ForceMarkedToAnotherPage(); @@ -695,9 +696,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) mpView->MarkObj(pObj,pPV); return true; } -/** -* Toggle between selection and rotation -**/ + +// check for single object selected SdrObject* pSingleObj = nullptr; if (mpView->GetMarkedObjectList().GetMarkCount()==1) @@ -705,6 +705,24 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); } +// Check for klick on svx::diagram::DiagramFrameHdl +// - if we hit a SdrHdl +// - if it was not moved +// - if single object is selected +// - and it is a Diagram +if(pHdl && !bWasDragged && nullptr != pSingleObj && pSingleObj->isDiagram()) +{ +svx::diagram::DiagramFrameHdl* pDiagramFrameHdl(dynamic_cast(pHdl)); +if(nullptr != pDiagramFrameHdl) +{ +// let the DiagramFrameHdl decide what to do +svx::diagram::DiagramFrameHdl::clicked(aPnt); +} +} + +/**
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/AccessibleShape.hxx|2 +- sd/source/ui/accessibility/AccessiblePresentationShape.cxx |2 +- sd/source/ui/inc/AccessiblePresentationShape.hxx |2 +- svx/source/accessibility/AccessibleShape.cxx |2 +- 4 files changed, 4 insertions(+), 4 deletions(-) New commits: commit 34e347db726a415f3f6df0c1f2112aff6d67bdeb Author: Noel Grandin AuthorDate: Sat Mar 5 09:40:41 2022 +0200 Commit: Noel Grandin CommitDate: Sat Mar 5 11:59:21 2022 +0100 AccessibleShape::GetStyle can be const Change-Id: Ic71ae0645c85ec27cc6a172d379070fe88a9f452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131045 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/AccessibleShape.hxx b/include/svx/AccessibleShape.hxx index 509bee235298..082bb72c4616 100644 --- a/include/svx/AccessibleShape.hxx +++ b/include/svx/AccessibleShape.hxx @@ -413,7 +413,7 @@ protected: /// @throws css::uno::RuntimeException OUString GetFullAccessibleName(AccessibleShape *shape); -virtual OUString GetStyle(); +virtual OUString GetStyle() const; /** Update the OPAQUE and SELECTED state. */ void UpdateStates(); diff --git a/sd/source/ui/accessibility/AccessiblePresentationShape.cxx b/sd/source/ui/accessibility/AccessiblePresentationShape.cxx index 3dacf6e73e8e..e4afe7e9a243 100644 --- a/sd/source/ui/accessibility/AccessiblePresentationShape.cxx +++ b/sd/source/ui/accessibility/AccessiblePresentationShape.cxx @@ -96,7 +96,7 @@ OUString AccessiblePresentationShape::CreateAccessibleBaseName() return sName; } -OUString AccessiblePresentationShape::GetStyle() +OUString AccessiblePresentationShape::GetStyle() const { OUString sName; diff --git a/sd/source/ui/inc/AccessiblePresentationShape.hxx b/sd/source/ui/inc/AccessiblePresentationShape.hxx index 1fd7d86b064f..4a6447ae974c 100644 --- a/sd/source/ui/inc/AccessiblePresentationShape.hxx +++ b/sd/source/ui/inc/AccessiblePresentationShape.hxx @@ -48,7 +48,7 @@ public: virtual OUString CreateAccessibleBaseName () override; -OUString GetStyle() override; +OUString GetStyle() const override; private: AccessiblePresentationShape (const AccessiblePresentationShape&) = delete; diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 8985e9cba6de..ee36cf297028 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -225,7 +225,7 @@ void AccessibleShape::UpdateStates() pStateSet->RemoveState (AccessibleStateType::SELECTED); } -OUString AccessibleShape::GetStyle() +OUString AccessibleShape::GetStyle() const { return ShapeTypeHandler::CreateAccessibleBaseName( mxShape ); }
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/ColorSets.hxx|4 sd/source/ui/inc/unokywds.hxx|1 + sd/source/ui/unoidl/unomodel.cxx | 25 + svx/source/styles/ColorSets.cxx | 32 4 files changed, 62 insertions(+) New commits: commit cd5c8e5a99f56d5af53b69dcb925f3aed77a815d Author: Sarper Akdemir AuthorDate: Tue Sep 7 10:14:52 2021 +0300 Commit: Miklos Vajna CommitDate: Thu Nov 18 09:00:59 2021 +0100 introduce XColorSetsManager interface [ Miklos: rather go with a beans::PropertyValues-based interface to allow extending this incrementally, without an API change. This allows getting / setting a per-document theme via the UNO API, but the concept from the original commit is unchanged. ] (cherry picked from commit 3f1bca8b4f451fa30bf341116390738c456d651f, from the feature/themesupport2 branch) Change-Id: I24be34a5a7b68549b21a6cd55144901d4fe2c5f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125436 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx index eee992da94b5..e6c9f1b4e7ee 100644 --- a/include/svx/ColorSets.hxx +++ b/include/svx/ColorSets.hxx @@ -85,6 +85,10 @@ public: const OUString& GetName() const; void dumpAsXml(xmlTextWriterPtr pWriter) const; + +void ToAny(css::uno::Any& rVal) const; + +static std::unique_ptr FromAny(const css::uno::Any& rVal); }; } // end of namespace svx diff --git a/sd/source/ui/inc/unokywds.hxx b/sd/source/ui/inc/unokywds.hxx index 13a4cd4dd258..7b078c11410b 100644 --- a/sd/source/ui/inc/unokywds.hxx +++ b/sd/source/ui/inc/unokywds.hxx @@ -59,6 +59,7 @@ inline constexpr OUStringLiteral sUNO_Prop_BookmarkURL = u"BookmarkURL"; inline constexpr OUStringLiteral sUNO_Prop_RuntimeUID = u"RuntimeUID"; inline constexpr OUStringLiteral sUNO_Prop_HasValidSignatures = u"HasValidSignatures"; inline constexpr OUStringLiteral sUNO_Prop_InteropGrabBag = u"InteropGrabBag"; +inline constexpr OUStringLiteral sUNO_Prop_Theme = u"Theme"; // view settings inline constexpr OUStringLiteral sUNO_View_ViewId = u"ViewId"; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index d4304815519f..e4b11eea33b5 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -125,6 +125,7 @@ #include #include #include +#include using namespace ::cppu; using namespace ::com::sun::star; @@ -197,6 +198,7 @@ const sal_uInt16 WID_MODEL_HASVALIDSIGNATURES = 11; const sal_uInt16 WID_MODEL_DIALOGLIBS = 12; const sal_uInt16 WID_MODEL_FONTS = 13; const sal_uInt16 WID_MODEL_INTEROPGRABBAG = 14; +const sal_uInt16 WID_MODEL_THEME = 15; static const SvxItemPropertySet* ImplGetDrawModelPropertySet() { @@ -217,6 +219,7 @@ static const SvxItemPropertySet* ImplGetDrawModelPropertySet() { sUNO_Prop_HasValidSignatures, WID_MODEL_HASVALIDSIGNATURES, ::cppu::UnoType::get(), beans::PropertyAttribute::READONLY, 0}, { u"Fonts",WID_MODEL_FONTS, cppu::UnoType>::get(), beans::PropertyAttribute::READONLY, 0}, { sUNO_Prop_InteropGrabBag, WID_MODEL_INTEROPGRABBAG, cppu::UnoType>::get(), 0, 0}, +{ sUNO_Prop_Theme,WID_MODEL_THEME, cppu::UnoType>::get(), 0, 0}, { u"", 0, css::uno::Type(), 0, 0 } }; static SvxItemPropertySet aDrawModelPropertySet_Impl( aDrawModelPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() ); @@ -1248,6 +1251,13 @@ void SAL_CALL SdXImpressDocument::setPropertyValue( const OUString& aPropertyNam case WID_MODEL_INTEROPGRABBAG: setGrabBagItem(aValue); break; +case WID_MODEL_THEME: +{ +SdrModel& rModel = getSdrModelFromUnoModel(); +std::unique_ptr pTheme = svx::Theme::FromAny(aValue); +rModel.SetTheme(std::move(pTheme)); +} +break; default: throw beans::UnknownPropertyException( aPropertyName, static_cast(this)); } @@ -1368,6 +1378,21 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property case WID_MODEL_INTEROPGRABBAG: getGrabBagItem(aAny); break; +case WID_MODEL_THEME: +{ +SdrModel& rModel = getSdrModelFromUnoModel(); +svx::Theme* pTheme = rModel.GetTheme(); +if (pTheme) +{ +pTheme->ToAny(aAny); +} +else +{ +beans::PropertyValues aValues; +aAny <<= aValues; +} +break; +} default: throw beans::UnknownPropertyException( PropertyName, static_
[Libreoffice-commits] core.git: include/svx sd/source svx/source sw/source
include/svx/scene3d.hxx |2 - include/svx/svdobj.hxx|2 - include/svx/svdomeas.hxx | 11 ++- sd/source/ui/func/fucon3d.cxx |2 - svx/source/customshapes/EnhancedCustomShape3d.cxx |2 - svx/source/dialog/dlgctl3d.cxx|4 +- svx/source/engine3d/obj3d.cxx |2 - svx/source/engine3d/scene3d.cxx | 24 +++ svx/source/sdr/properties/attributeproperties.cxx | 10 +++--- svx/source/svdraw/svdoashp.cxx| 20 ++-- svx/source/svdraw/svdoattr.cxx|2 - svx/source/svdraw/svdobj.cxx | 12 +++ svx/source/svdraw/svdocapt.cxx|4 +- svx/source/svdraw/svdocirc.cxx| 10 +++--- svx/source/svdraw/svdoedge.cxx| 12 +++ svx/source/svdraw/svdograf.cxx|2 - svx/source/svdraw/svdogrp.cxx | 10 +++--- svx/source/svdraw/svdomeas.cxx| 12 +++ svx/source/svdraw/svdopath.cxx|8 ++--- svx/source/svdraw/svdotext.cxx|4 +- svx/source/svdraw/svdotxat.cxx|4 +- svx/source/svdraw/svdotxdr.cxx|2 - svx/source/svdraw/svdotxtr.cxx| 14 - svx/source/svdraw/svdouno.cxx |2 - svx/source/svdraw/svdovirt.cxx| 34 +++--- svx/source/svdraw/svdpage.cxx |2 - svx/source/table/svdotable.cxx| 10 +++--- svx/source/unodraw/unopage.cxx|2 - sw/source/core/draw/dcontact.cxx | 26 sw/source/core/layout/fly.cxx |2 - sw/source/core/layout/tabfrm.cxx |4 +- 31 files changed, 133 insertions(+), 124 deletions(-) New commits: commit 8c8d878632f4aa32a63080f6956b8cb76f48af0f Author: Noel Grandin AuthorDate: Fri Aug 13 16:13:19 2021 +0200 Commit: Noel Grandin CommitDate: Tue Aug 17 10:40:43 2021 +0200 rename SetRectsDirty->SetBoundAndSnapRectsDirty because there are lots of things being marked dirty, and I like to be sure I know what the code is doing Change-Id: Ifd0380c5560adc4a054495551885fe33af4f3e5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120460 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx index d2d91f3c3e9c..8903e3bd4f2d 100644 --- a/include/svx/scene3d.hxx +++ b/include/svx/scene3d.hxx @@ -174,7 +174,7 @@ public: virtual SdrObject* RemoveObject(size_t nObjNum) override; // needed for group functionality -virtual void SetRectsDirty(bool bNotMyself = false, bool bRecursive = true) override; +virtual void SetBoundAndSnapRectsDirty(bool bNotMyself = false, bool bRecursive = true) override; virtual void NbcSetLayer(SdrLayerID nLayer) override; // react on model/page change diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index d3b8089d4d64..5a4460dd9ddd 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -339,7 +339,7 @@ public: /// /// This is needed for instance for NbcMove, because usually one moves SnapRect and aOutRect /// at the same time to avoid recomputation. -virtual void SetRectsDirty(bool bNotMyself = false, bool bRecursive = true); +virtual void SetBoundAndSnapRectsDirty(bool bNotMyself = false, bool bRecursive = true); // frees the SdrObject pointed to by the argument // In case the object has an SvxShape, which has the ownership of the object, it diff --git a/include/svx/svdomeas.hxx b/include/svx/svdomeas.hxx index 15a6d0e0026e..cd00b7d26d1c 100644 --- a/include/svx/svdomeas.hxx +++ b/include/svx/svdomeas.hxx @@ -61,7 +61,16 @@ private: void ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol) const; static basegfx::B2DPolyPolygon ImpCalcXPoly(const ImpMeasurePoly& rPol); void ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) const; -void SetTextDirty() { bTextDirty=true; SetTextSizeDirty(); if (!m_aOutRect.IsEmpty()) { SetBoundRectDirty(); SetRectsDirty(true); } } +void SetTextDirty() +{ +bTextDirty=true; +SetTextSizeDirty(); +if (!m_aOutRect.IsEmpty()) +{ +SetBoundRectDirty(); +SetBoundAndSnapRectsDirty(/*bNotMyself*/true); +} +} void UndirtyText() const; virtual std::unique_ptr NewGeoData() const override; diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx index 32ec30b8fc48..eb0f35b84eae 100644 --- a/sd/source/ui/func/fucon3d.cxx +++ b/sd/source/ui/func/fucon3d.cxx @@ -412,7 +412,7 @@ SdrObjectUniquePtr FuConstruct3dObjec
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdedtv.hxx|6 +- sd/source/ui/func/futransf.cxx | 13 - svx/source/svdraw/svdedtv1.cxx |8 +++- 3 files changed, 20 insertions(+), 7 deletions(-) New commits: commit 2246b6a2887b90efc712c4479b19609cf9307a3d Author: mert AuthorDate: Thu Mar 4 12:17:27 2021 +0300 Commit: Mert Tumer CommitDate: Fri Mar 12 04:36:28 2021 +0100 Fix wrong position on move when page has margin Change-Id: I9ac2d9914b86210ca2148b44488c2c70cc5870d4 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111949 Reviewed-by: Miklos Vajna Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111929 Tested-by: Jenkins diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index 916fdaeb186b..eb815b728cb3 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -304,7 +304,11 @@ public: // geometrical attribute (position, size, rotation angle) // A PageOrigin set at a position is taken into account. SfxItemSet GetGeoAttrFromMarked() const; -void SetGeoAttrToMarked(const SfxItemSet& rAttr); +// In LOK, interactive shape movement uses this function +// in that case, margin is not taken into account +// and the final position of the shape becomes incorrect +// However, "Position and Size" dialog and other cases already add the margins. +void SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin = false); // Returns NULL if: // - nothing is marked, diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx index fa7398e48b43..6c07e0e70be6 100644 --- a/sd/source/ui/func/futransf.cxx +++ b/sd/source/ui/func/futransf.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -48,14 +49,13 @@ rtl::Reference FuTransform::Create( ViewShell* pViewSh, ::sd::Window* pW namespace { -void setUndo(::sd::View* pView, const SfxItemSet* pArgs) +void setUndo(::sd::View* pView, const SfxItemSet* pArgs, bool addPageMargin) { // Undo OUString aString = pView->GetDescriptionOfMarkedObjects() + " " + SdResId(STR_TRANSFORM); pView->BegUndo(aString); - -pView->SetGeoAttrToMarked(*pArgs); +pView->SetGeoAttrToMarked(*pArgs, addPageMargin); pView->SetAttributes(*pArgs); pView->EndUndo(); } @@ -71,7 +71,9 @@ void FuTransform::DoExecute( SfxRequest& rReq ) if (pArgs) { -setUndo(mpView, pArgs); +// If this comes from LOK, that means the shape is moved by mouse +// only then pArgs is pre-set. +setUndo(mpView, pArgs, comphelper::LibreOfficeKit::isActive()); return; } @@ -115,7 +117,8 @@ void FuTransform::DoExecute( SfxRequest& rReq ) if (nResult == RET_OK) { pRequest->Done(*(pDlg->GetOutputItemSet())); -setUndo(mpView, pRequest->GetArgs()); +// Page margin is already calculated at this point. +setUndo(mpView, pRequest->GetArgs(), false); } // deferred until the dialog ends diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index f2128824b6fa..5b17b8852462 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1512,7 +1512,7 @@ static Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP) return Point(); // Should not happen! } -void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) +void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin) { const bool bTiledRendering = comphelper::LibreOfficeKit::isActive(); @@ -1520,6 +1520,12 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) if(GetSdrPageView()) { +if (addPageMargin) +{ +SdrPage * pPage = GetSdrPageView()->GetPage(); +Point upperLeft(pPage->GetLeftBorder(), pPage->GetUpperBorder()); +aRect.Move(upperLeft.getX(), upperLeft.getY()); +} GetSdrPageView()->LogicToPagePos(aRect); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/ShapeTypeHandler.hxx |2 +- sd/source/ui/accessibility/SdShapeTypes.cxx |2 +- svx/source/accessibility/ShapeTypeHandler.cxx |2 +- svx/source/accessibility/SvxShapeTypes.cxx|2 +- svx/source/form/filtnav.cxx |2 +- svx/source/form/fmexch.cxx|2 +- svx/source/form/fmtextcontrolshell.cxx|6 +++--- svx/source/inc/filtnav.hxx|2 +- svx/source/inc/fmexch.hxx |4 ++-- svx/source/inc/fmtextcontrolshell.hxx |2 +- 10 files changed, 13 insertions(+), 13 deletions(-) New commits: commit 3c699b2a480e0795a3a7085c2bcd1a9e8d649ed2 Author: Noel AuthorDate: Mon Mar 1 14:35:54 2021 +0200 Commit: Noel Grandin CommitDate: Mon Mar 1 19:30:37 2021 +0100 loplugin:refcounting in svx Change-Id: I87b1d0684e6e8921b222f76a13a36706c0eb8c87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111750 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/ShapeTypeHandler.hxx b/include/svx/ShapeTypeHandler.hxx index ccf61121876f..15992311dfc2 100644 --- a/include/svx/ShapeTypeHandler.hxx +++ b/include/svx/ShapeTypeHandler.hxx @@ -44,7 +44,7 @@ typedef int ShapeTypeId; /** Define the function type for creating accessible objects for given service names. */ -typedef AccessibleShape* (*tCreateFunction) +typedef rtl::Reference (*tCreateFunction) (const AccessibleShapeInfo& rShapeInfo, const AccessibleShapeTreeInfo& rShapeTreeInfo, ShapeTypeId nId); diff --git a/sd/source/ui/accessibility/SdShapeTypes.cxx b/sd/source/ui/accessibility/SdShapeTypes.cxx index a6159b05f7a0..7fab0961ee27 100644 --- a/sd/source/ui/accessibility/SdShapeTypes.cxx +++ b/sd/source/ui/accessibility/SdShapeTypes.cxx @@ -25,7 +25,7 @@ namespace accessibility { -static AccessibleShape* +static rtl::Reference CreateSdAccessibleShape ( const AccessibleShapeInfo& rShapeInfo, const AccessibleShapeTreeInfo& rShapeTreeInfo, diff --git a/svx/source/accessibility/ShapeTypeHandler.cxx b/svx/source/accessibility/ShapeTypeHandler.cxx index 03ef0bf86bb6..368c2f698ee9 100644 --- a/svx/source/accessibility/ShapeTypeHandler.cxx +++ b/svx/source/accessibility/ShapeTypeHandler.cxx @@ -40,7 +40,7 @@ ShapeTypeHandler* ShapeTypeHandler::instance = nullptr; // Create an empty reference to an accessible object. -static AccessibleShape* +static rtl::Reference CreateEmptyShapeReference ( const AccessibleShapeInfo& /*rShapeInfo*/, const AccessibleShapeTreeInfo& /*rShapeTreeInfo*/, diff --git a/svx/source/accessibility/SvxShapeTypes.cxx b/svx/source/accessibility/SvxShapeTypes.cxx index 5ca2804b5d7f..b02a153a4cdb 100644 --- a/svx/source/accessibility/SvxShapeTypes.cxx +++ b/svx/source/accessibility/SvxShapeTypes.cxx @@ -28,7 +28,7 @@ namespace accessibility { -static AccessibleShape* CreateSvxAccessibleShape ( +static rtl::Reference CreateSvxAccessibleShape ( const AccessibleShapeInfo& rShapeInfo, const AccessibleShapeTreeInfo& rShapeTreeInfo, ShapeTypeId nId) diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 7e9e53c62d7f..cee9f5d3c71b 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -103,7 +103,7 @@ SotClipboardFormatId OFilterItemExchange::getFormatId() return s_nFormat; } -OLocalExchange* OFilterExchangeHelper::createExchange() const +rtl::Reference OFilterExchangeHelper::createExchange() const { return new OFilterItemExchange; } diff --git a/svx/source/form/fmexch.cxx b/svx/source/form/fmexch.cxx index 38e5fbd947cb..002b3b6175fc 100644 --- a/svx/source/form/fmexch.cxx +++ b/svx/source/form/fmexch.cxx @@ -306,7 +306,7 @@ namespace svxform } //= OControlExchangeHelper -OLocalExchange* OControlExchangeHelper::createExchange() const +rtl::Reference OControlExchangeHelper::createExchange() const { return new OControlExchange; } diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index a9ec64108a85..0818e9c7be8a 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -1226,9 +1226,9 @@ namespace svx SfxSlotId* pSlots = _pZeroTerminatedSlots; while ( *pSlots ) { -FmTextControlFeature* pDispatcher = implGetFeatureDispatcher( xProvider, pApplication, *pSlots ); +rtl::Reference pDispatcher = implGetFeatureDispatcher( xProvider, pApplication, *pSlots ); if ( pDispatcher ) -_rDispatchers.emplace( *pSlots, ControlFeature( pDispatcher ) ); +_rDispatchers.emplace( *pSlots, pDispatcher ); ++pSlots; } @@ -1236,7 +1236,7 @@ namespace svx } -FmTextControlFeature* FmTextControlShell::implGetFeatureDispatcher( const Reference< XDis
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdobj.hxx |2 +- sd/source/ui/dlg/sdtreelb.cxx | 15 ++- sd/source/ui/view/drviewsd.cxx |2 +- svx/source/svdraw/svdobj.cxx |9 ++--- 4 files changed, 22 insertions(+), 6 deletions(-) New commits: commit f0878173e1963cf8db5f60ced6d19da24e18bc41 Author: Jim Raykowski AuthorDate: Tue Dec 1 00:25:52 2020 -0900 Commit: Jim Raykowski CommitDate: Thu Dec 3 21:38:48 2020 +0100 tdf#34828 sd navigator: make unnamed shape select select shape object Change-Id: I4685d7db802767553018d08d23d8b33bca7efff2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106958 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 2c9ce6813fba..b7af53864a77 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -373,7 +373,7 @@ public: // An object may have a user-set Name (Get/SetName()), e.g SdrGrafObj, SdrObjGroup // or SdrOle2Obj. // It may also have a Title and a Description for accessibility purposes. -void SetName(const OUString& rStr); +void SetName(const OUString& rStr, const bool bSetChanged = true); OUString GetName() const; void MakeNameUnique(); void MakeNameUnique(std::unordered_set& rNameSet); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index bd9215fcb5b1..12ba6be2cf45 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -701,7 +701,20 @@ void SdPageObjsTLV::Select() m_aChangeHdl.Call(*m_xTreeView); if (m_bSelectionHandlerNavigates) -m_aRowActivatedHdl.Call(*m_xTreeView); +{ +SdrObject* pObject = reinterpret_cast(m_xTreeView->get_selected_id().toInt64()); +if (pObject && pObject->GetName().isEmpty()) +{ +const bool bUndo = pObject->getSdrModelFromSdrObject().IsUndoEnabled(); +pObject->getSdrModelFromSdrObject().EnableUndo(false); +pObject->SetName(m_xTreeView->get_selected_text(), false); +m_aRowActivatedHdl.Call(*m_xTreeView); +pObject->SetName(OUString(), false); +pObject->getSdrModelFromSdrObject().EnableUndo(bUndo); +} +else +m_aRowActivatedHdl.Call(*m_xTreeView); +} if (!m_xNavigator) { diff --git a/sd/source/ui/view/drviewsd.cxx b/sd/source/ui/view/drviewsd.cxx index 8f6e627029d4..6dc4448d32f1 100644 --- a/sd/source/ui/view/drviewsd.cxx +++ b/sd/source/ui/view/drviewsd.cxx @@ -137,7 +137,7 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq ) SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame); SfxBoolItem aBrowseItem(SID_BROWSE, true); pFrame->GetDispatcher()-> -ExecuteList(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, +ExecuteList(SID_OPENDOC, SfxCallMode::SYNCHRON | SfxCallMode::RECORD, { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer }); } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 638c590a52cd..260d0b0dd2ac 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -661,7 +661,7 @@ SdrObject* SdrObject::getParentSdrObjectFromSdrObject() const return pParent->getSdrObjectFromSdrObjList(); } -void SdrObject::SetName(const OUString& rStr) +void SdrObject::SetName(const OUString& rStr, const bool bSetChanged) { if (!rStr.isEmpty() && !pPlusData) { @@ -691,8 +691,11 @@ void SdrObject::SetName(const OUString& rStr) { getSdrModelFromSdrObject().EndUndo(); } -SetChanged(); -BroadcastObjectChange(); +if (bSetChanged) +{ +SetChanged(); +BroadcastObjectChange(); +} } OUString SdrObject::GetName() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdobj.hxx |5 + sd/source/core/sdpage2.cxx |6 +- svx/source/svdraw/svdotextdecomposition.cxx | 28 ++-- 3 files changed, 32 insertions(+), 7 deletions(-) New commits: commit b12b1663d135f94eb56f3c1f852ef008e87c4e5f Author: Luboš Luňák AuthorDate: Fri Oct 9 18:10:50 2020 +0200 Commit: Luboš Luňák CommitDate: Fri Oct 16 10:11:38 2020 +0200 try to prefetch also graphics for background fill bitmap Change-Id: Ib6be487500e45ab984b7ca63d85352696d9d4051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104132 Tested-by: Jenkins Reviewed-by: Luboš Luňák diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index de4ebc3f9b4f..cb98d67a2891 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -74,6 +74,7 @@ class SdrGluePointList; class SdrLayerIDSet; class Fraction; enum class PointerStyle; +class Graphic; namespace basegfx { @@ -917,6 +918,8 @@ public: const css::uno::WeakReference< css::uno::XInterface >& getWeakUnoShape() const { return maWeakUnoShape; } void setSuitableOutlinerBg(Outliner& rOutliner) const; +// If fillstyle is drawing::FillStyle_BITMAP, returns the graphic. +const Graphic* getFillGraphic() const; protected: tools::RectangleaOutRect; // surrounding rectangle for Paint (incl. LineWidth, ...) @@ -995,6 +998,8 @@ protected: // helper function for reimplementing Clone(). template< typename T > T* CloneHelper(SdrModel& rTargetModel) const; +const SfxItemSet* getBackgroundFillSet() const; + private: struct Impl; std::unique_ptr mpImpl; diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx index 089712ab2693..142b40a6bb25 100644 --- a/sd/source/core/sdpage2.cxx +++ b/sd/source/core/sdpage2.cxx @@ -614,9 +614,13 @@ void SdPage::getGraphicsForPrefetch(std::vector& graphics) const { for( size_t i = 0; i < GetObjCount(); ++i) { -if( SdrGrafObj* grafObj = dynamic_cast(GetObj(i))) +SdrObject* obj = GetObj(i); +if( SdrGrafObj* grafObj = dynamic_cast(obj)) if(!grafObj->GetGraphic().isAvailable()) graphics.push_back( const_cast(&grafObj->GetGraphic())); +if( const Graphic* fillGraphic = obj->getFillGraphic()) +if(!fillGraphic->isAvailable()) +graphics.push_back( const_cast(fillGraphic)); } } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 499585c7f5f5..1650ffa71fab 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -860,6 +861,17 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive( // Resolves: fdo#35779 set background color of this shape as the editeng background if there // is one. Check the shape itself, then the host page, then that page's master page. void SdrObject::setSuitableOutlinerBg(::Outliner& rOutliner) const +{ +const SfxItemSet* pBackgroundFillSet = getBackgroundFillSet(); +if (drawing::FillStyle_NONE != pBackgroundFillSet->Get(XATTR_FILLSTYLE).GetValue()) +{ +Color aColor(rOutliner.GetBackgroundColor()); +GetDraftFillColor(*pBackgroundFillSet, aColor); +rOutliner.SetBackgroundColor(aColor); +} +} + +const SfxItemSet* SdrObject::getBackgroundFillSet() const { const SfxItemSet* pBackgroundFillSet = &GetObjectItemSet(); @@ -879,13 +891,17 @@ void SdrObject::setSuitableOutlinerBg(::Outliner& rOutliner) const } } } +return pBackgroundFillSet; +} -if (drawing::FillStyle_NONE != pBackgroundFillSet->Get(XATTR_FILLSTYLE).GetValue()) -{ -Color aColor(rOutliner.GetBackgroundColor()); -GetDraftFillColor(*pBackgroundFillSet, aColor); -rOutliner.SetBackgroundColor(aColor); -} +const Graphic* SdrObject::getFillGraphic() const +{ +if(IsGroupObject()) // Doesn't make sense, and GetObjectItemSet() asserts. +return nullptr; +const SfxItemSet* pBackgroundFillSet = getBackgroundFillSet(); +if (drawing::FillStyle_BITMAP != pBackgroundFillSet->Get(XATTR_FILLSTYLE).GetValue()) +return nullptr; +return &pBackgroundFillSet->Get(XATTR_FILLBITMAP).GetGraphicObject().GetGraphic(); } void SdrTextObj::impDecomposeBlockTextPrimitive( ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdmrkv.hxx |4 ++-- sd/source/ui/app/sdxfer.cxx |2 +- svx/source/dialog/dlgctrl.cxx |6 +++--- svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx |2 +- 4 files changed, 7 insertions(+), 7 deletions(-) New commits: commit d350f0c712cf7b29d8c633be0394b63de0f8dc3a Author: Andrea Gelmini AuthorDate: Mon Aug 31 14:55:28 2020 +0200 Commit: Julien Nabet CommitDate: Tue Sep 1 08:52:10 2020 +0200 Fix typo Change-Id: If76dc19adc13548afc0ee5b521321ca439da638d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101782 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx index bc4016d69801..f75ffa896d7e 100644 --- a/include/svx/svdmrkv.hxx +++ b/include/svx/svdmrkv.hxx @@ -101,7 +101,7 @@ class SVXCORE_DLLPUBLIC SdrMarkView : public SdrSnapView protected: SdrObject* mpMarkedObj; // If not just one object ( i.e. More than one object ) is marked. -SdrPageView*mpMarkedPV;// If all marked obects are situated on the same PageView. +SdrPageView*mpMarkedPV;// If all marked objects are situated on the same PageView. Point maRef1;// Persistent - Rotation center / axis of reflection Point maRef2;// Persistent @@ -453,7 +453,7 @@ public: // a vertical area of 200 logical units is sensitive. // - For a polygon, a rectangular of the size (200,200) is generated and a // touch test between Poly and this Rect is processed. -// - Obects which respond SdrObject::HasEdit()==TRUE ( e.g. a text frame ), +// - Objects which respond SdrObject::HasEdit()==TRUE ( e.g. a text frame ), // are specially treated: An additional sensitive area with a width of // 2*Tol (200 units for this example) is created around the object. // When an object is directly hit, the Edit method is called. diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index b56c4a7c6389..c473468e1dfe 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -221,7 +221,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) // as content and directly add this to the clipboard, probably to avoid adding // an unnecessary DrawObject to the target where paste may take place. This is // wanted only for SdrObjects with no fill and no line, else it is necessary to -// use the whole SdrObect. Test here for Line/FillStyle and take shortcut only +// use the whole SdrObject. Test here for Line/FillStyle and take shortcut only // when both are unused if(!pObj->HasFillStyle() && !pObj->HasLineStyle()) { diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 75f9319fce5f..4a353d55033a 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1066,7 +1066,7 @@ void SvxXLinePreview::Resize() const sal_Int32 nDistance(500); const sal_Int32 nAvailableLength(aOutputSize.Width() - (4 * nDistance)); -// create DrawObectA +// create DrawObjectA const sal_Int32 aYPosA(aOutputSize.Height() / 2); const basegfx::B2DPoint aPointA1( nDistance, aYPosA); const basegfx::B2DPoint aPointA2( aPointA1.getX() + ((nAvailableLength * 14) / 20), aYPosA ); @@ -1075,7 +1075,7 @@ void SvxXLinePreview::Resize() aPolygonA.append(aPointA2); mpLineObjA->SetPathPoly(basegfx::B2DPolyPolygon(aPolygonA)); -// create DrawObectB +// create DrawObjectB const sal_Int32 aYPosB1((aOutputSize.Height() * 3) / 4); const sal_Int32 aYPosB2((aOutputSize.Height() * 1) / 4); const basegfx::B2DPoint aPointB1( aPointA2.getX() + nDistance, aYPosB1); @@ -1087,7 +1087,7 @@ void SvxXLinePreview::Resize() aPolygonB.append(aPointB3); mpLineObjB->SetPathPoly(basegfx::B2DPolyPolygon(aPolygonB)); -// create DrawObectC +// create DrawObjectC basegfx::B2DPolygon aPolygonC; const basegfx::B2DPoint aPointC1( aPointB3.getX() + nDistance, aYPosB1); const basegfx::B2DPoint aPointC2( aPointC1.getX() + ((nAvailableLength * 1) / 20), aYPosB2 ); diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index 3ac982af73df..ccc70b0d3805 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -134,7 +134,7 @@ namespace sdr::contact // see createViewIndependentPrimitive2DSequence implementations and usage of // GetObjectCount()). Thus in principle iterating here (esp. 'deep') seems
[Libreoffice-commits] core.git: include/svx sd/source svx/source sw/source
include/svx/svdmodel.hxx |7 ++ include/svx/svdobj.hxx |3 + include/svx/svdpage.hxx |5 + sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 12 +++- sd/source/ui/view/sdview3.cxx|7 ++ svx/source/svdraw/svdedtv.cxx|3 - svx/source/svdraw/svdmodel.cxx |3 + svx/source/svdraw/svdobj.cxx | 40 ++ svx/source/svdraw/svdpage.cxx| 54 +++ svx/source/svdraw/svdxcgv.cxx|5 + sw/source/core/doc/doclay.cxx|4 - 11 files changed, 136 insertions(+), 7 deletions(-) New commits: commit 9f86b320a997c77069cf93dcb32fb71f09ad1348 Author: Jim Raykowski AuthorDate: Thu Aug 15 00:31:25 2019 -0800 Commit: Noel Grandin CommitDate: Mon Oct 28 10:22:59 2019 +0100 tdf#125191 Give object copies unique names This patch makes a unique name for a copy of an object having a user given name. Change-Id: I14a7f45cc02962fc34a1532dd5db1cb9657b41d3 Reviewed-on: https://gerrit.libreoffice.org/77500 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index d5c14c0baa57..8153e4f915cc 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -260,6 +260,9 @@ private: // this is a weak reference to a possible living api wrapper for this model css::uno::Reference< css::uno::XInterface > mxUnoModel; +// used to disable unique name checking during page move +bool mbMakePageObjectsNamesUnique = true; + public: SVX_DLLPRIVATE virtual bool IsCreatingDataObj() const { return false; } bool IsTransportContainer() const { return bTransportContainer; } @@ -597,6 +600,10 @@ public: also during the runtime of the Undo() and Redo() methods. */ bool IsUndoEnabled() const; +// used to prevent object name change during page move +bool DoesMakePageObjectsNamesUnique() const { return mbMakePageObjectsNamesUnique; } +void DoMakePageObjectsNamesUnique(bool bDo) { mbMakePageObjectsNamesUnique = bDo; } + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; }; diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 97f082563281..3d0699b3f63c 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -38,6 +38,8 @@ #include #include +#include + class SfxBroadcaster; class AutoTimer; class OutlinerParaObject; @@ -425,6 +427,7 @@ public: // It may also have a Title and a Description for accessibility purposes. void SetName(const OUString& rStr); OUString GetName() const; +void MakeNameUnique(std::unordered_set& rNameSet); void SetTitle(const OUString& rStr); OUString GetTitle() const; void SetDescription(const OUString& rStr); diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index 60cf0bb49004..cdeb74d3714b 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -110,6 +110,9 @@ public: virtual void InsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE); virtual void sort( std::vector& sortOrder ); +void InsertObjectThenMakeNameUnique(SdrObject* pObj); +void InsertObjectThenMakeNameUnique(SdrObject* pObj, std::unordered_set& rNameSet, size_t nPos=SAL_MAX_SIZE); + /// remove from list without delete virtual SdrObject* NbcRemoveObject(size_t nObjNum); virtual SdrObject* RemoveObject(size_t nObjNum); @@ -487,6 +490,8 @@ public: void TRG_SetMasterPageVisibleLayers(const SdrLayerIDSet& rNew); sdr::contact::ViewContact& TRG_GetMasterPageDescriptorViewContact() const; +void MakePageObjectsNamesUnique(); + protected: void TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage); public: diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 95a38e0ee03f..38fcbd964f18 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -730,7 +730,17 @@ sal_Int8 Clipboard::ExecuteDrop ( mrSlideSorter.GetViewShell()->GetViewShellBase().GetMainViewShell())); mxSelectionObserverContext.reset(new SelectionObserver::Context(mrSlideSorter)); -HandlePageDrop(*pDragTransferable); +if (rEvent.mnAction == DND_ACTION_MOVE) +{ +SdDrawDocument* pDoc = mrSlideSorter.GetModel().GetDocument(); +const bool bDoesMakePageObjectsNamesUnique = pDoc->DoesMakePageObjectsNamesUnique(); +pDoc->DoMakePageObjectsNamesUnique(false); +HandlePageDrop(*pDragTransferable); + pDoc->DoMakePageObjectsNamesUnique(bDoesMakePageObjectsName
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdmodel.hxx |2 +- sd/source/ui/unoidl/unomodel.cxx |5 + svx/source/gallery2/galobj.cxx |2 +- svx/source/svdraw/svdmodel.cxx |2 +- 4 files changed, 4 insertions(+), 7 deletions(-) New commits: commit b883e3d58db404a92bee044091b6cfd3892311c2 Author: Arkadiy Illarionov AuthorDate: Wed Sep 18 20:54:55 2019 +0300 Commit: Stephan Bergmann CommitDate: Wed Sep 18 21:53:27 2019 +0200 tdf#39593 use isUnoTunnelId in sd Rename SdrModel::getUnoTunnelImplementationId() Change-Id: I364a05efe8ddc04b2b2ca393416c9b974ded43df Reviewed-on: https://gerrit.libreoffice.org/79108 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index f7ffa515a0e0..d5c14c0baa57 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -585,7 +585,7 @@ public: bool IsInDestruction() const { return mbInDestruction;} -static const css::uno::Sequence< sal_Int8 >& getUnoTunnelImplementationId(); +static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId(); /** enables (true) or disables (false) recording of undo actions If undo actions are added while undo is disabled, they are deleted. diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 878db5a6175f..cf31dfa902e7 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -343,11 +343,8 @@ sal_Int64 SAL_CALL SdXImpressDocument::getSomething( const css::uno::Sequence< s if( isUnoTunnelId(rIdentifier) ) return sal::static_int_cast(reinterpret_cast(this)); -if( (rIdentifier.getLength() == 16) && -(0 == memcmp( SdrModel::getUnoTunnelImplementationId().getConstArray(), rIdentifier.getConstArray(), 16 ))) -{ +if( isUnoTunnelId(rIdentifier) ) return sal::static_int_cast(reinterpret_cast(mpDoc)); -} return SfxBaseModel::getSomething( rIdentifier ); } diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index c08b84809cfe..23b1e3cda851 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -405,7 +405,7 @@ SvxGalleryDrawModel::SvxGalleryDrawModel() if( xTunnel.is() ) { mpFormModel = dynamic_cast< FmFormModel* >( - reinterpret_cast(xTunnel->getSomething(SdrModel::getUnoTunnelImplementationId(; + reinterpret_cast(xTunnel->getSomething(SdrModel::getUnoTunnelId(; if( mpFormModel ) { mpFormModel->InsertPage( mpFormModel->AllocPage( false ) ); diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index a833a85baec7..eec87abcdf73 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -2004,7 +2004,7 @@ namespace class theSdrModelUnoTunnelImplementationId : public rtl::Static< UnoTunnelIdInit, theSdrModelUnoTunnelImplementationId > {}; } -const css::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelImplementationId() +const css::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelId() { return theSdrModelUnoTunnelImplementationId::get().getSeq(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/sdr/contact/viewcontact.hxx |8 +--- include/svx/sdr/contact/viewcontactofsdrobj.hxx |2 +- sd/source/core/CustomAnimationEffect.cxx |2 +- svx/source/engine3d/view3d.cxx|2 +- svx/source/sdr/contact/viewcontact.cxx|8 svx/source/sdr/contact/viewcontactofsdrobj.cxx|8 svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx |2 +- svx/source/sdr/contact/viewcontactofvirtobj.cxx |2 +- svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx |2 +- svx/source/svdraw/svdobj.cxx |4 ++-- svx/source/svdraw/svdotxtr.cxx|2 +- 11 files changed, 22 insertions(+), 20 deletions(-) New commits: commit 2340c2ffe46271c5a14e8831b8a8f5b56ed2da8c Author: Noel Grandin AuthorDate: Wed Sep 4 09:17:42 2019 +0200 Commit: Noel Grandin CommitDate: Wed Sep 4 10:16:20 2019 +0200 reduce Primitive2DContainer copying Change-Id: I418b17034c1949ddda1de7025821ca51f4cdb018 Reviewed-on: https://gerrit.libreoffice.org/78579 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx index edc70af19b54..d3455ac77cd0 100644 --- a/include/svx/sdr/contact/viewcontact.hxx +++ b/include/svx/sdr/contact/viewcontact.hxx @@ -124,10 +124,12 @@ public: // add Gluepoints (if available) virtual drawinglayer::primitive2d::Primitive2DContainer createGluePointPrimitive2DSequence() const; -// allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This +// Allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This // is a helper normally used from getViewIndependentPrimitive2DContainer(), but there is one exception -// for 3D scenes -virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DContainer& rSource) const; +// for 3D scenes. +// We take the param by value, since, for the common case, we can just std::move into the param, and +// std::move the result out, avoiding copying. +virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(drawinglayer::primitive2d::Primitive2DContainer rSource) const; virtual basegfx::B2DRange getRange( const drawinglayer::geometry::ViewInformation2D& rViewInfo2D ) const; diff --git a/include/svx/sdr/contact/viewcontactofsdrobj.hxx b/include/svx/sdr/contact/viewcontactofsdrobj.hxx index df2840476bcd..2508316a7c9f 100644 --- a/include/svx/sdr/contact/viewcontactofsdrobj.hxx +++ b/include/svx/sdr/contact/viewcontactofsdrobj.hxx @@ -77,7 +77,7 @@ public: // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This // is a helper normally used from getViewIndependentPrimitive2DContainer(), but there is one exception // for 3D scenes -virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DContainer& rSource) const override; +virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(drawinglayer::primitive2d::Primitive2DContainer aSource) const override; }; }} diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 102df7fb1f2f..1a08b9b4d7de 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -1563,7 +1563,7 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj { ::tools::Rectangle aBoundRect(0,0,0,0); -const drawinglayer::primitive2d::Primitive2DContainer xPrimitives(pObj->GetViewContact().getViewIndependentPrimitive2DContainer()); +const drawinglayer::primitive2d::Primitive2DContainer& xPrimitives(pObj->GetViewContact().getViewIndependentPrimitive2DContainer()); const drawinglayer::geometry::ViewInformation2D aViewInformation2D; const basegfx::B2DRange aRange(xPrimitives.getB2DRange(aViewInformation2D)); diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index b6d170554f64..67b974b26cb0 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -124,7 +124,7 @@ Impl3DMirrorConstructOverlay::Impl3DMirrorConstructOverlay(const E3dView& rView) { // use the view-independent primitive representation (without // evtl. GridOffset, that may be applied to the DragEntry individually) -const drawinglayer::primitive2d::Primitive2DContainer aNewSequence( +const drawinglayer::primitive2d::Pr
[Libreoffice-commits] core.git: include/svx sd/source svx/source sw/source
include/svx/pszctrl.hxx |2 ++ include/svx/zoomctrl.hxx|2 ++ sd/source/ui/app/tmplctrl.cxx |1 - svx/source/stbctrls/insctrl.cxx |1 - svx/source/stbctrls/pszctrl.cxx | 31 +-- svx/source/stbctrls/zoomctrl.cxx| 12 sw/source/uibase/utlui/bookctrl.cxx |1 - sw/source/uibase/utlui/tmplctrl.cxx |1 - sw/source/uibase/utlui/zoomctrl.cxx |6 +- 9 files changed, 38 insertions(+), 19 deletions(-) New commits: commit c53f3f8f58f55d0978fb968446975856d72a52f8 Author: Noel Grandin AuthorDate: Fri Aug 16 15:33:15 2019 +0200 Commit: Noel Grandin CommitDate: Fri Aug 16 21:40:17 2019 +0200 tdf#126819 Can't retrieve the mouse position written in the statusbar regression from commit 77e260f915e0c77ddb1e915e9fd27ab0bdccc763 Date: Mon Jul 8 11:22:12 2019 +0200 tdf#121793 speedup VCLXAccessibleStatusBarItem::GetItemText Make the custom StatusBarControls set better text on their parent StatusBar. Also remove some unnecessary work being done in the Paint methods, to reduce confusion. Change-Id: I3b0a0af3b01d3b01f85ab335a3eb5993c07a50f4 Reviewed-on: https://gerrit.libreoffice.org/77586 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/pszctrl.hxx b/include/svx/pszctrl.hxx index d22e0ba05d18..faf8923d94cc 100644 --- a/include/svx/pszctrl.hxx +++ b/include/svx/pszctrl.hxx @@ -39,6 +39,8 @@ public: virtual voidStateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override; virtual voidPaint( const UserDrawEvent& rEvt ) override; virtual voidCommand( const CommandEvent& rCEvt ) override; +private: +void ImplUpdateItemText(); }; #endif diff --git a/include/svx/zoomctrl.hxx b/include/svx/zoomctrl.hxx index afd3130e2c20..e0daa4b971ca 100644 --- a/include/svx/zoomctrl.hxx +++ b/include/svx/zoomctrl.hxx @@ -40,6 +40,8 @@ public: SvxZoomStatusBarControl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb ); +private: +void ImplUpdateItemText(); }; class SVX_DLLPUBLIC SvxZoomPageStatusBarControl : public SfxStatusBarControl diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx index 2c27db05bafb..c78f1a3ef126 100644 --- a/sd/source/ui/app/tmplctrl.cxx +++ b/sd/source/ui/app/tmplctrl.cxx @@ -89,7 +89,6 @@ void SdTemplateControl::StateChanged( void SdTemplateControl::Paint( const UserDrawEvent& ) { -GetStatusBar().SetItemText( GetId(), msTemplate ); } void SdTemplateControl::Command( const CommandEvent& rCEvt ) diff --git a/svx/source/stbctrls/insctrl.cxx b/svx/source/stbctrls/insctrl.cxx index 952f82332f8e..eaad418e4909 100644 --- a/svx/source/stbctrls/insctrl.cxx +++ b/svx/source/stbctrls/insctrl.cxx @@ -65,7 +65,6 @@ void SvxInsertStatusBarControl::StateChanged( sal_uInt16 , SfxItemState eState, void SvxInsertStatusBarControl::Paint( const UserDrawEvent& ) { -DrawItemText_Impl(); } void SvxInsertStatusBarControl::DrawItemText_Impl() diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index 474ca2c81f0d..06877c8f06e4 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -231,6 +231,7 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( sal_uInt16 _nSlotId, addStatusListener( STR_POSITION); // SID_ATTR_POSITION addStatusListener( STR_TABLECELL); // SID_TABLE_CELL addStatusListener( STR_FUNC);// SID_PSZ_FUNCTION +ImplUpdateItemText(); } /* [Description] @@ -334,12 +335,7 @@ void SvxPosSizeStatusBarControl::StateChanged( sal_uInt16 nSID, SfxItemState eSt GetStatusBar().SetItemData( GetId(), nullptr ); -// set only strings as text at the statusBar, so that the Help-Tips -// can work with the text, when it is too long for the statusBar -OUString aText; -if ( pImpl->bTable ) -aText = pImpl->aStr; -GetStatusBar().SetItemText( GetId(), aText ); +ImplUpdateItemText(); } @@ -461,4 +457,27 @@ void SvxPosSizeStatusBarControl::Paint( const UserDrawEvent& rUsrEvt ) pDev->SetFillColor( aOldFillColor ); } +void SvxPosSizeStatusBarControl::ImplUpdateItemText() +{ +// set only strings as text at the statusBar, so that the Help-Tips +// can work with the text, when it is too long for the statusBar +OUString aText; +if ( pImpl->bPos || pImpl->bSize ) +{ +aText = GetMetricStr_Impl( pImpl->aPos.X()); +aText += " / "; +aText += GetMetricStr_Impl( pImpl->aPos.Y()); +if ( pImpl->bSize ) +{ +aText += " "; +aText += GetMetricStr_Impl( pImpl->aSize.Width() ); +aText += " x "; +aText += GetMetricStr_Impl( pImpl->aSize.Height() ); +} +} +else if ( pImpl->bTable ) + aText = pImpl->aStr; + +GetStatusBar().SetItemText( GetId()
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdedtv.hxx|5 -- sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |2 svx/source/svdraw/svddrgmt.cxx |3 - svx/source/svdraw/svdedtv.cxx | 13 ++--- svx/source/svdraw/svdedtv1.cxx | 42 +++-- svx/source/svdraw/svdedxv.cxx |3 - 6 files changed, 44 insertions(+), 24 deletions(-) New commits: commit e6c7a018a0cfee395ce2886d41c908a2447ef5cc Author: Xisco Fauli AuthorDate: Tue Jul 2 00:01:01 2019 +0200 Commit: Miklos Vajna CommitDate: Wed Jul 3 09:18:41 2019 +0200 tdf#126180: EndTextEdit on all views before delete/cut slide This also reworks the fixes tdf#125824 and tdf#111522 to use EndTextEdit instead of blocking the undoing Change-Id: I73c2289a9d950465f020f684e9e736148380f5c5 Reviewed-on: https://gerrit.libreoffice.org/74989 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index 0305b7fb144c..87fd275b187d 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -186,10 +186,9 @@ public: bool IsUndoEnabled() const; /** - * Checks if this or other views have an active text edit, in which case object undos are not - * created. + * Checks if this or other views have an active text edit, if true, end them. */ -bool CanDoSdrUndo() const; +void EndTextEditAllViews() const; std::vector< std::unique_ptr > CreateConnectorUndo( SdrObject& rO ); void AddUndoActions( std::vector< std::unique_ptr > ); diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 55b58e197f1c..17b4adeeb958 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -234,6 +234,7 @@ void SlotManager::FuTemporary (SfxRequest& rRequest) // (DEL -> accelerator -> SID_CUT). if (mrSlideSorter.GetModel().GetPageCount() > 1) { +mrSlideSorter.GetView().EndTextEditAllViews(); mrSlideSorter.GetController().GetSelectionManager()->DeleteSelectedPages(); } @@ -371,6 +372,7 @@ void SlotManager::FuSupport (SfxRequest& rRequest) case SID_CUT: case SID_COPY: case SID_DELETE: +mrSlideSorter.GetView().EndTextEditAllViews(); mrSlideSorter.GetController().GetClipboard().HandleSlotCall(rRequest); break; diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index f41a7991ccec..400cab8f936b 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1366,10 +1366,11 @@ bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/) { std::unique_ptr pUndo; std::unique_ptr pUndo2; -const bool bUndo = getSdrDragView().IsUndoEnabled() && getSdrDragView().CanDoSdrUndo(); +const bool bUndo = getSdrDragView().IsUndoEnabled(); if( bUndo ) { +getSdrDragView().EndTextEditAllViews(); if(!getSdrDragView().IsInsObjPoint() && pObj->IsInserted() ) { if (DragStat().IsEndDragChangesAttributes()) diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index e424276da087..d83910a86746 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -973,8 +973,11 @@ bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, SdrInser if (!pObj->IsInserted()) { rPV.GetObjList()->InsertObject(pObj, SAL_MAX_SIZE); } -if( IsUndoEnabled() && CanDoSdrUndo()) +if( IsUndoEnabled()) +{ +EndTextEditAllViews(); AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pObj)); +} if (!(nOptions & SdrInsertFlags::DONTMARK)) { if (!(nOptions & SdrInsertFlags::ADDMARK)) UnmarkAllObj(); @@ -1029,20 +1032,18 @@ bool SdrEditView::IsUndoEnabled() const return mpModel->IsUndoEnabled(); } -bool SdrEditView::CanDoSdrUndo() const +void SdrEditView::EndTextEditAllViews() const { size_t nViews = mpModel->GetListenerCount(); for (size_t nView = 0; nView < nViews; ++nView) { -SdrEditView* pView = dynamic_cast(mpModel->GetListener(nView)); +SdrObjEditView* pView = dynamic_cast(mpModel->GetListener(nView)); if (!pView) continue; if (pView->IsTextEdit()) -return false; +pView->SdrEndTextEdit(); } - -return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 47e05a0ad5e4..44c4b2fe5201 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -88,9 +88,12 @@ void SdrEditView::SetMa
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/graphctl.hxx |3 ++- include/svx/svdpntv.hxx |5 ++--- sd/source/ui/inc/ClientView.hxx |4 ++-- sd/source/ui/view/clview.cxx |4 ++-- svx/source/dialog/graphctl.cxx | 15 +-- svx/source/svdraw/sdrpagewindow.cxx |2 +- svx/source/svdraw/sdrpaintwindow.cxx |6 -- svx/source/svdraw/svdpagv.cxx|2 +- svx/source/svdraw/svdpntv.cxx| 10 ++ 9 files changed, 29 insertions(+), 22 deletions(-) New commits: commit 810e1a86b0f87086f972f0b1190130ce3ec088b2 Author: Caolán McNamara AuthorDate: Thu May 16 13:57:07 2019 +0100 Commit: Caolán McNamara CommitDate: Fri May 17 18:10:30 2019 +0200 there's already a way to customize the invalidation Change-Id: I486494de730b8665e56cfc664b62830fb0b8b8ee Reviewed-on: https://gerrit.libreoffice.org/72415 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx index b4044d2b072b..d4fe23b3abca 100644 --- a/include/svx/graphctl.hxx +++ b/include/svx/graphctl.hxx @@ -264,7 +264,8 @@ public: // override these so we can get the occasions SdrPaintView would call Window::Invalidate on its vcl::Window // if it had one, and route to WidgetController::Invalidate instead virtual rtl::Reference CreateOverlayManager(OutputDevice& rDevice) const override; -virtual void InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const override; +virtual void InvalidateOneWin(OutputDevice& rWin) override; +virtual void InvalidateOneWin(OutputDevice& rWin, const tools::Rectangle& rRect) override; }; #endif // INCLUDED_SVX_GRAPHCTL_HXX diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index 7fe1a838b8d3..ce62413bc7c5 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -238,7 +238,6 @@ public: SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const; // Replacement for GetWin(0), may return 0L (!) OutputDevice* GetFirstOutputDevice() const; -virtual void InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const; private: SVX_DLLPRIVATE void ImpClearVars(); @@ -432,8 +431,8 @@ public: /// If the View should not call Invalidate() on the windows, override /// the following 2 methods and do something else. -virtual void InvalidateOneWin(vcl::Window& rWin); -virtual void InvalidateOneWin(vcl::Window& rWin, const tools::Rectangle& rRect); +virtual void InvalidateOneWin(OutputDevice& rWin); +virtual void InvalidateOneWin(OutputDevice& rWin, const tools::Rectangle& rRect); void SetActiveLayer(const OUString& rName) { maActualLayer=rName; } const OUString& GetActiveLayer() const { return maActualLayer; } diff --git a/sd/source/ui/inc/ClientView.hxx b/sd/source/ui/inc/ClientView.hxx index a7bb20b51bf2..a616a6252bce 100644 --- a/sd/source/ui/inc/ClientView.hxx +++ b/sd/source/ui/inc/ClientView.hxx @@ -38,8 +38,8 @@ public: /* if the view should not do a Invalidate() on the windows, you have to override the following two methods and do something different */ -virtual void InvalidateOneWin(vcl::Window& rWin) override; -virtual void InvalidateOneWin(vcl::Window& rWin, const ::tools::Rectangle& rRect) override; +virtual void InvalidateOneWin(OutputDevice& rWin) override; +virtual void InvalidateOneWin(OutputDevice& rWin, const ::tools::Rectangle& rRect) override; }; } // end of namespace sd diff --git a/sd/source/ui/view/clview.cxx b/sd/source/ui/view/clview.cxx index 29905c83909f..a73bd292314f 100644 --- a/sd/source/ui/view/clview.cxx +++ b/sd/source/ui/view/clview.cxx @@ -48,7 +48,7 @@ ClientView::~ClientView() * to be overridden and properly handled. */ -void ClientView::InvalidateOneWin(vcl::Window& rWin) +void ClientView::InvalidateOneWin(OutputDevice& rWin) { vcl::Region aRegion; CompleteRedraw(&rWin, aRegion); @@ -59,7 +59,7 @@ void ClientView::InvalidateOneWin(vcl::Window& rWin) * to be overridden and properly handled. */ -void ClientView::InvalidateOneWin(vcl::Window& rWin, const ::tools::Rectangle& rRect) +void ClientView::InvalidateOneWin(OutputDevice& rWin, const ::tools::Rectangle& rRect) { CompleteRedraw(&rWin, vcl::Region(rRect)); } diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index d77a7c6e6069..470912a649c5 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -1494,7 +1494,18 @@ rtl::Reference SvxGraphCtrlView::CreateOverlayMana return SdrView::CreateOverlayManager(rDevice); } -void SvxGraphCtrlView::InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const +void SvxGraphCtrlView::InvalidateOneWin(OutputDevice& rDevice) +{ +assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device()); +if (rDevice.GetOutDevType()
[Libreoffice-commits] core.git: include/svx sd/source svx/source sw/source
include/svx/svdedtv.hxx| 94 +++ sd/source/ui/inc/View.hxx | 12 - svx/source/engine3d/view3d.cxx | 14 +- svx/source/svdraw/svddrgv.cxx |2 svx/source/svdraw/svdedtv.cxx | 256 - svx/source/svdraw/svdedtv1.cxx | 22 +-- svx/source/svdraw/svdedtv2.cxx | 12 - sw/source/core/draw/dview.cxx | 10 - 8 files changed, 211 insertions(+), 211 deletions(-) New commits: commit 8cbe779fcbcfcd722a64f98f5cef3df63d02e037 Author: Miklos Vajna AuthorDate: Mon Nov 12 09:18:56 2018 +0100 Commit: Miklos Vajna CommitDate: Mon Nov 12 12:45:53 2018 +0100 svx: prefix members of SdrEditView Change-Id: I3e27d8444c5a152ee39b9e2cc12b9df707f092b8 Reviewed-on: https://gerrit.libreoffice.org/63281 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index ba6b1172df6b..6fc2e1aab75f 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -78,41 +78,41 @@ class SVX_DLLPUBLIC SdrEditView : public SdrMarkView protected: // cache the transformation queries, etc. a little -boolbPossibilitiesDirty : 1; -boolbReadOnly : 1; -boolbGroupPossible : 1; -boolbUnGroupPossible : 1; -boolbGrpEnterPossible : 1; -boolbToTopPossible : 1; -boolbToBtmPossible : 1; -boolbReverseOrderPossible : 1; -boolbImportMtfPossible : 1; -boolbCombinePossible : 1; -boolbDismantlePossible : 1; -boolbCombineNoPolyPolyPossible : 1; -boolbDismantleMakeLinesPossible : 1; -boolbOrthoDesiredOnMarked : 1; -boolbOneOrMoreMovable : 1;// at least one object is moveable -boolbMoreThanOneNoMovRot : 1; // more then one object is not movable nor turnable (Crook) -boolbContortionPossible : 1; // all polygones (grouped if necessary) -boolbMoveAllowed : 1; -boolbResizeFreeAllowed : 1; -boolbResizePropAllowed : 1; -boolbRotateFreeAllowed : 1; -boolbRotate90Allowed : 1; -boolbMirrorFreeAllowed : 1; -boolbMirror45Allowed : 1; -boolbMirror90Allowed : 1; -boolbShearAllowed : 1; -boolbEdgeRadiusAllowed : 1; -boolbTransparenceAllowed : 1; -boolbCropAllowed : 1; -boolbGradientAllowed : 1; -boolbCanConvToPath : 1; -boolbCanConvToPoly : 1; -boolbCanConvToContour : 1; -boolbMoveProtect : 1; -boolbResizeProtect : 1; +boolm_bPossibilitiesDirty : 1; +boolm_bReadOnly : 1; +boolm_bGroupPossible : 1; +boolm_bUnGroupPossible : 1; +boolm_bGrpEnterPossible : 1; +boolm_bToTopPossible : 1; +boolm_bToBtmPossible : 1; +boolm_bReverseOrderPossible : 1; +boolm_bImportMtfPossible : 1; +boolm_bCombinePossible : 1; +boolm_bDismantlePossible : 1; +boolm_bCombineNoPolyPolyPossible : 1; +boolm_bDismantleMakeLinesPossible : 1; +boolm_bOrthoDesiredOnMarked : 1; +boolm_bOneOrMoreMovable : 1;// at least one object is moveable +boolm_bMoreThanOneNoMovRot : 1; // more then one object is not movable nor turnable (Crook) +boolm_bContortionPossible : 1; // all polygones (grouped if necessary) +boolm_bMoveAllowed : 1; +boolm_bResizeFreeAllowed : 1; +boolm_bResizePropAllowed : 1; +boolm_bRotateFreeAllowed : 1; +boolm_bRotate90Allowed : 1; +boolm_bMirrorFreeAllowed : 1; +boolm_bMirror45Allowed : 1; +boolm_bMirror90Allowed : 1; +boolm_bShearAllowed : 1; +boolm_bEdgeRadiusAllowed : 1; +bo
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdobj.hxx|3 - include/svx/svdopath.hxx |3 - include/svx/svdovirt.hxx |3 - sd/source/ui/animations/motionpathtag.cxx | 17 ++ svx/source/svdraw/svdmrkv.cxx | 17 ++ svx/source/svdraw/svdmrkv1.cxx| 17 ++ svx/source/svdraw/svdobj.cxx |8 -- svx/source/svdraw/svdopath.cxx| 84 +- svx/source/svdraw/svdovirt.cxx| 19 +++--- 9 files changed, 64 insertions(+), 107 deletions(-) New commits: commit f74b888244fcefa7c03fa25db4d42c839ebbf642 Author: Noel Grandin AuthorDate: Thu Sep 20 14:23:13 2018 +0200 Commit: Noel Grandin CommitDate: Fri Sep 21 15:46:54 2018 +0200 simplify PlusHdl logic like we did with the AddToHdlList stuff, all the client code cares about is fetching the entire list Change-Id: Id3cefa5f316a3f979a276c64f9125943d0981842 Reviewed-on: https://gerrit.libreoffice.org/60813 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 5c5fb75ca26a..91225c243545 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -521,8 +521,7 @@ public: /// An object that returns true from HasSpacialDrag() must provide these /// methods (incl. FillHdlList()). virtual sal_uInt32 GetHdlCount() const; -virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const; -virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlNum) const; +virtual void AddToPlusHdlList(SdrHdlList& rHdlList, SdrHdl& rHdl) const; virtual void AddToHdlList(SdrHdlList& rHdlList) const; virtual void addCropHandles(SdrHdlList& rTarget) const; diff --git a/include/svx/svdopath.hxx b/include/svx/svdopath.hxx index 66c3b0410e5b..0dc07e11d5d0 100644 --- a/include/svx/svdopath.hxx +++ b/include/svx/svdopath.hxx @@ -87,8 +87,7 @@ public: virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; virtual sal_uInt32 GetHdlCount() const override; virtual void AddToHdlList(SdrHdlList& rHdlList) const override; -virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const override; -virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlNum) const override; +virtual void AddToPlusHdlList(SdrHdlList& rHdlList, SdrHdl& rHdl) const override; // special drag methods virtual bool hasSpecialDrag() const override; diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx index 5d562a73e2c9..47ed2f4b1d03 100644 --- a/include/svx/svdovirt.hxx +++ b/include/svx/svdovirt.hxx @@ -77,8 +77,7 @@ public: virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; virtual sal_uInt32 GetHdlCount() const override; -virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const override; -virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlNum) const override; +virtual void AddToPlusHdlList(SdrHdlList& rHdlList, SdrHdl& rHdl) const override; virtual void AddToHdlList(SdrHdlList& rHdlList) const override; // special drag methods diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 0a6a5ca6e94b..c6e83af4b701 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -915,18 +915,17 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList ) if( mrView.IsPlusHandlesAlwaysVisible() || bSelected ) { -sal_uInt32 nPlusHdlCnt=mpPathObj->GetPlusHdlCount(*pSmartHdl); +SdrHdlList plusList(nullptr); +mpPathObj->AddToPlusHdlList(plusList, *pSmartHdl); +sal_uInt32 nPlusHdlCnt=plusList.GetHdlCount(); for (sal_uInt32 nPlusNum=0; nPlusNumGetPlusHdl(*pSmartHdl,nPlusNum); -if (pPlusHdl!=nullptr) -{ -pPlusHdl->SetObj(mpPathObj); -pPlusHdl->SetPageView(mrView.GetSdrPageView()); -pPlusHdl->SetPlusHdl(true); -rHandlerList.AddHdl(pPlusHdl); -} +SdrHdl* pPlusHdl = plusList.GetHdl(nPlusNum); +pPlusHdl->SetObj(mpPathObj); +pPlusHdl->SetPageView(mrView.GetSdrPageView()); +pPlusHdl->SetPlusHdl(true); } +plusList.MoveTo(rHandlerList); } } } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 084d936e1baa..d3133ee49301 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -918,18 +918,17 @@ void SdrMarkView::
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdobj.hxx |3 + sd/source/ui/view/sdview.cxx|8 +-- svx/source/svdraw/svdotextdecomposition.cxx | 59 +++- 3 files changed, 39 insertions(+), 31 deletions(-) New commits: commit 3ec86ad77071af577f37a83a0b1d0389b2204716 Author: Caolán McNamara AuthorDate: Thu Aug 16 12:04:48 2018 +0100 Commit: Caolán McNamara CommitDate: Thu Aug 16 15:00:56 2018 +0200 tdf#119284 bg for automatic not set while editing refactor and reuse fdo#35779 solution for this case Change-Id: I0631cd2560aa2acc2310f95b5c4dea36a2845a58 Reviewed-on: https://gerrit.libreoffice.org/59165 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 1d112cc3841e..d01031c40112 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -43,6 +43,7 @@ class SfxBroadcaster; class Pointer; class AutoTimer; class OutlinerParaObject; +class Outliner; class SdrOutliner; class SdrDragStat; class SdrHdl; @@ -918,6 +919,8 @@ public: const css::uno::WeakReference< css::uno::XInterface >& getWeakUnoShape() const { return maWeakUnoShape; } +void setSuitableOutlinerBg(Outliner& rOutliner) const; + protected: tools::RectangleaOutRect; // surrounding rectangle for Paint (incl. LineWdt, ...) Point aAnchor; // anchor position (Writer) diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index bbb5d417422f..527c1e06f2a1 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -715,18 +715,18 @@ bool View::SdrBeginTextEdit( if (::Outliner* pOL = bReturn ? GetTextEditOutliner() : nullptr) { -if (pObj && pObj->getSdrPageFromSdrObject()) +if (pObj) { -Color aBackground; if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_TABLE ) { +Color aBackground; aBackground = GetTextEditBackgroundColor(*this); +pOL->SetBackgroundColor( aBackground ); } else { -aBackground = pObj->getSdrPageFromSdrObject()->GetPageBackgroundColor(pPV); +pObj->setSuitableOutlinerBg(*pOL); } -pOL->SetBackgroundColor( aBackground ); } pOL->SetParaInsertedHdl(LINK(this, View, OnParagraphInsertedHdl)); diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 70f23a4e5974..5a79e8818b6d 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -852,6 +852,37 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive( rTarget = aConverter.getPrimitive2DSequence(); } +// Resolves: fdo#35779 set background color of this shape as the editeng background if there +// is one. Check the shape itself, then the host page, then that page's master page. +void SdrObject::setSuitableOutlinerBg(::Outliner& rOutliner) const +{ +const SfxItemSet* pBackgroundFillSet = &GetObjectItemSet(); + +if (drawing::FillStyle_NONE == pBackgroundFillSet->Get(XATTR_FILLSTYLE).GetValue()) +{ +SdrPage* pOwnerPage(getSdrPageFromSdrObject()); +if (pOwnerPage) +{ +pBackgroundFillSet = &pOwnerPage->getSdrPageProperties().GetItemSet(); + +if (drawing::FillStyle_NONE == pBackgroundFillSet->Get(XATTR_FILLSTYLE).GetValue()) +{ +if (!pOwnerPage->IsMasterPage() && pOwnerPage->TRG_HasMasterPage()) +{ +pBackgroundFillSet = &pOwnerPage->TRG_GetMasterPage().getSdrPageProperties().GetItemSet(); +} +} +} +} + +if (drawing::FillStyle_NONE != pBackgroundFillSet->Get(XATTR_FILLSTYLE).GetValue()) +{ +Color aColor(rOutliner.GetBackgroundColor()); +GetDraftFillColor(*pBackgroundFillSet, aColor); +rOutliner.SetBackgroundColor(aColor); +} +} + void SdrTextObj::impDecomposeBlockTextPrimitive( drawinglayer::primitive2d::Primitive2DContainer& rTarget, const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive, @@ -882,35 +913,9 @@ void SdrTextObj::impDecomposeBlockTextPrimitive( rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(Size(100,100)); -// Resolves: fdo#35779 set background color of this shape as the editeng background if there -// is one. Check the shape itself, then the host page, then that page's master page. // That color needs to be restored on leaving this method Color aOriginalBackColor(rOutliner.GetBackgroundColor()); -const SfxItemSet* pBackgroundFillSet = &GetObjectItemSet(); - -if (drawing::FillStyle_NONE == pBackgroundFi
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/obj3d.hxx |1 include/svx/scene3d.hxx |3 - sd/source/ui/func/fucon3d.cxx |2 svx/source/customshapes/EnhancedCustomShape3d.cxx |8 +- svx/source/dialog/dlgctl3d.cxx| 14 ++-- svx/source/engine3d/obj3d.cxx |8 -- svx/source/engine3d/scene3d.cxx | 66 -- svx/source/engine3d/view3d.cxx|6 +- 8 files changed, 41 insertions(+), 67 deletions(-) New commits: commit 2c85607101e2e04e870e3b87362f39f9a9148e6c Author: Armin Le Grand Date: Fri Jun 15 20:34:37 2018 +0200 AW080: Cleanup of 3D Object methods Change-Id: I3a8247aabd2fd24b53faf9e1e8da29856dde70bf Reviewed-on: https://gerrit.libreoffice.org/55897 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/include/svx/obj3d.hxx b/include/svx/obj3d.hxx index a14279523de1..bfb730d28df0 100644 --- a/include/svx/obj3d.hxx +++ b/include/svx/obj3d.hxx @@ -93,7 +93,6 @@ private: boolmbIsSelected: 1; protected: -virtual void NewObjectInserted(const E3dObject* p3DObj); virtual void StructureChanged(); virtual basegfx::B3DRange RecalcBoundVolume() const; diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx index 1ebf4ac9728b..9b8e4b4f88bd 100644 --- a/include/svx/scene3d.hxx +++ b/include/svx/scene3d.hxx @@ -78,7 +78,6 @@ protected: bool mbSkipSettingDirty : 1; -virtual void NewObjectInserted(const E3dObject* p3DObj) override; virtual void StructureChanged() override; void RebuildLists(); @@ -195,8 +194,6 @@ public: virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override; virtual SdrObjList* GetSubList() const override; -void Insert3DObj(E3dObject* p3DObj); -void Remove3DObj(E3dObject const * p3DObj); virtual void SetTransformChanged() override; protected: diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx index f74db13144eb..6761ad0e8295 100644 --- a/sd/source/ui/func/fucon3d.cxx +++ b/sd/source/ui/func/fucon3d.cxx @@ -407,7 +407,7 @@ SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const aCam.SetFocalLength(mpView->GetDefaultCamFocal()); aCam.SetDefaults(::basegfx::B3DPoint(0.0, 0.0, fDefaultCamPosZ), aLookAt); pScene->SetCamera(aCam); -pScene->Insert3DObj(p3DObj); +pScene->InsertObject(p3DObj); pScene->NbcSetSnapRect(a3DRect); ImpPrepareBasic3DShape(p3DObj, pScene); SfxItemSet aAttr(mpDoc->GetPool()); diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index 7741fa46b170..752054bce703 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -531,7 +531,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( p3DObj->SetMergedItem(XFillBitmapItem(OUString(), Graphic(aFillBmp))); } } -pScene->Insert3DObj( p3DObj ); +pScene->InsertObject( p3DObj ); p3DObj = new E3dExtrudeObj( rSdrObjCustomShape.getSdrModelFromSdrObject(), a3DDefaultAttr, @@ -544,7 +544,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( p3DObj->SetMergedItem( XFillStyleItem( drawing::FillStyle_SOLID ) ); p3DObj->SetMergedItem( Svx3DCloseFrontItem( false ) ); p3DObj->SetMergedItem( Svx3DCloseBackItem( false ) ); -pScene->Insert3DObj( p3DObj ); +pScene->InsertObject( p3DObj ); // #i122777# depth 0 is okay for planes when using double-sided p3DObj = new E3dExtrudeObj( @@ -573,7 +573,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( p3DObj->SetMergedItem( Svx3DCloseFrontItem( false ) ); p3DObj->SetMergedItem( Svx3DCloseBackItem( false ) ); } -pScene->Insert3DObj( p3DObj ); +pScene->InsertObject( p3DObj ); bSceneHasObjects = true; } } @@ -742,7 +742,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( for (std::vector< E3dCompoundObject* >::iterator aObjectListIter( aPlaceholderObjectList.begin() ); aObjectListIter != aPlaceholderObjectList.end(); ) { E3dCompoundObject* pTemp(*aObjectListIter++); -pScene->Remove3DObj( pTemp ); +pScene->RemoveObject( pTemp->GetOrdNum() ); // always use SdrObject::Free(...) for SdrObjects (!) SdrObject* pTemp2(pTemp); SdrObject::Free(pTemp2); diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/d
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdetc.hxx |5 - sd/source/ui/animations/CustomAnimationPane.cxx |8 svx/source/svdraw/svdetc.cxx|8 3 files changed, 4 insertions(+), 17 deletions(-) New commits: commit 9134a9402610af7bff17b2bba9a4ba30e0b5a65f Author: Gabor Kelemen Date: Sat Apr 21 21:50:09 2018 +0200 Drop sdr::GetResourceString l10n method from svx A l10n wrapper method above another wrapper method above SvxResId. Just use plain SvxResId instead. Change-Id: I85276caa193c9a20f285e832764cd920df4af3fb Reviewed-on: https://gerrit.libreoffice.org/53273 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx index 20d37c3c6d4f..c39e77b7d174 100644 --- a/include/svx/svdetc.hxx +++ b/include/svx/svdetc.hxx @@ -201,11 +201,6 @@ public: SVX_DLLPUBLIC SdrGlobalData & GetSdrGlobalData(); -namespace sdr -{ -SVX_DLLPUBLIC OUString GetResourceString(const char* pResID); -} - // #i101872# isolated GetTextEditBackgroundColor for tooling class SdrObjEditView; diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index c0c5cf887d2c..01c5a1c9283f 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -76,8 +76,8 @@ #include #include -#include #include +#include #include #include #include @@ -2211,9 +2211,9 @@ sal_uInt32 CustomAnimationPane::fillAnimationLB( bool bHasText ) { OUString sMotionPathLabel( SdResId( STR_CUSTOMANIMATION_USERPATH ) ); mpLBAnimation->InsertCategory( sMotionPathLabel ); -mnCurvePathPos = mpLBAnimation->InsertEntry( sdr::GetResourceString(STR_ObjNameSingulCOMBLINE) ); -mnPolygonPathPos = mpLBAnimation->InsertEntry( sdr::GetResourceString(STR_ObjNameSingulPOLY) ); -mnFreeformPathPos = mpLBAnimation->InsertEntry( sdr::GetResourceString(STR_ObjNameSingulFREELINE) ); +mnCurvePathPos = mpLBAnimation->InsertEntry( SvxResId(STR_ObjNameSingulCOMBLINE) ); +mnPolygonPathPos = mpLBAnimation->InsertEntry( SvxResId(STR_ObjNameSingulPOLY) ); +mnFreeformPathPos = mpLBAnimation->InsertEntry( SvxResId(STR_ObjNameSingulFREELINE) ); } while(aCategoryIter != aCategoryEnd) diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index 24479d6e8a06..b1ab9536c7d8 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -358,14 +358,6 @@ OUString ImpGetResStr(const char* pResID) return SvxResId(pResID); } -namespace sdr -{ -OUString GetResourceString(const char* pResID) -{ -return ImpGetResStr(pResID); -} -} - bool SearchOutlinerItems(const SfxItemSet& rSet, bool bInklDefaults, bool* pbOnlyEE) { bool bHas=false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/source svx/source sw/source
include/svx/ClassificationCommon.hxx |8 +++ sd/source/ui/view/drviews2.cxx | 59 +++- svx/source/dialog/ClassificationCommon.cxx | 31 +++-- svx/source/dialog/ClassificationDialog.cxx | 69 - sw/source/core/edit/edfcol.cxx | 67 +++- 5 files changed, 81 insertions(+), 153 deletions(-) New commits: commit 0a4ad544daaec4f773480e6301238c7f6958a9ab Author: Tomaž Vajngerl Date: Mon Nov 6 13:30:01 2017 +0900 TSCP: put more duplicated methods to common Change-Id: Ic49e0dad1351684db3372214604d12b48d0be907 Reviewed-on: https://gerrit.libreoffice.org/44337 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/svx/ClassificationCommon.hxx b/include/svx/ClassificationCommon.hxx index 04e0494cc7ad..2276c962532d 100644 --- a/include/svx/ClassificationCommon.hxx +++ b/include/svx/ClassificationCommon.hxx @@ -23,6 +23,14 @@ namespace classification { SVX_DLLPUBLIC OUString convertClassificationResultToString(std::vector const & rResults); +SVX_DLLPUBLIC OUString getProperty(css::uno::Reference const & rxPropertyContainer, + OUString const & rName); + +SVX_DLLPUBLIC bool containsProperty(css::uno::Sequence const & rProperties, +OUString const & rName); + +SVX_DLLPUBLIC void removeAllProperties(css::uno::Reference const & rxPropertyContainer); + SVX_DLLPUBLIC bool addOrInsertDocumentProperty(css::uno::Reference const & rxPropertyContainer, OUString const & rsKey, OUString const & rsValue); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 8a0c20a41889..2095738f62f6 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -192,49 +192,6 @@ namespace sd { namespace { -void lcl_removeAllProperties(uno::Reference const & rxPropertyContainer) -{ -uno::Reference xPropertySet(rxPropertyContainer, uno::UNO_QUERY); -uno::Sequence aProperties = xPropertySet->getPropertySetInfo()->getProperties(); - -for (const beans::Property& rProperty : aProperties) -{ -rxPropertyContainer->removeProperty(rProperty.Name); -} -} - -bool lcl_containsProperty(const uno::Sequence & rProperties, const OUString& rName) -{ -return std::find_if(rProperties.begin(), rProperties.end(), [&](const beans::Property& rProperty) -{ -return rProperty.Name == rName; -}) != rProperties.end(); -} - -OUString lcl_getProperty(uno::Reference const & rxPropertyContainer, const OUString& rName) -{ -uno::Reference xPropertySet(rxPropertyContainer, uno::UNO_QUERY); -return xPropertySet->getPropertyValue(rName).get(); -} - -bool addOrInsertDocumentProperty(uno::Reference const & rxPropertyContainer, OUString const & rsKey, OUString const & rsValue) -{ -uno::Reference xPropertySet(rxPropertyContainer, uno::UNO_QUERY); - -try -{ -if (lcl_containsProperty(xPropertySet->getPropertySetInfo()->getProperties(), rsKey)) -xPropertySet->setPropertyValue(rsKey, uno::makeAny(rsValue)); -else -rxPropertyContainer->addProperty(rsKey, beans::PropertyAttribute::REMOVABLE, uno::makeAny(rsValue)); -} -catch (const uno::Exception& /*rException*/) -{ -return false; -} -return true; -} - const SvxFieldItem* findField(editeng::Section const & rSection) { for (SfxPoolItem const * pPool: rSection.maAttributes) @@ -321,22 +278,22 @@ private: OUString aKey = pCustomPropertyField->GetName(); if (aKeyCreator.isMarkingTextKey(aKey)) { -OUString aValue = lcl_getProperty(xPropertyContainer, aKey); +OUString aValue = svx::classification::getProperty(xPropertyContainer, aKey); m_aResults.push_back({ svx::ClassificationType::TEXT, aValue, sBlank, sBlank }); } else if (aKeyCreator.isCategoryNameKey(aKey) || aKeyCreator.isCategoryIdentifierKey(aKey)) { -OUString aValue = lcl_getProperty(xPropertyContainer, aKey); +OUString aValue = svx::classification::getProperty(xPropertyContainer, aKey); m_aResults.push_back({ svx::ClassificationType::CATEGORY, aValue, sBlank, sBlank }); } else if (aKeyCreator.isMarkingKey(aKey)) { -OUString aValue = lcl_getProperty(xPropertyContainer, aKey); +OUString aValue = svx::classification::getProperty(xPropertyContainer, aKey); m_aResults.push_back({ svx::ClassificationType::MARKING, aValue, sBlank, sBlank }); } else if (aKeyCreator.isIntellectualPropertyPartKey(aKey)) { -
[Libreoffice-commits] core.git: include/svx sd/source svx/source sw/source
include/svx/ClassificationField.hxx| 40 +++-- sd/source/ui/view/drviews2.cxx | 18 ++--- svx/source/dialog/ClassificationDialog.cxx | 20 +++--- sw/source/core/edit/edfcol.cxx | 16 +-- 4 files changed, 59 insertions(+), 35 deletions(-) New commits: commit 25a26b66b398d127842369e06c3ef95fe901e305 Author: Ashod Nakashian Date: Mon Oct 30 14:25:23 2017 -0400 TSCP: flesh out ClassificationResult Change-Id: Ie6ee33cc21f6f27ae1d58a0e47f367b0539e4378 Reviewed-on: https://gerrit.libreoffice.org/44117 Tested-by: Jenkins Reviewed-by: Ashod Nakashian diff --git a/include/svx/ClassificationField.hxx b/include/svx/ClassificationField.hxx index 4d4588c68177..32f783eb1896 100644 --- a/include/svx/ClassificationField.hxx +++ b/include/svx/ClassificationField.hxx @@ -26,6 +26,38 @@ enum class ClassificationType PARAGRAPH, }; +class SVX_DLLPUBLIC ClassificationResult +{ +public: +ClassificationType meType; +OUString msName;//< Display text or 'Name' field (from example.xml). +OUString msAbbreviatedName; //< Abbreviated name, displayed instead of Name. +OUString msIdentifier; //< The identifier of this entry (from example.xml). + +ClassificationResult(ClassificationType eType, const OUString& sName, + const OUString& sAbbreviatedName = "", const OUString& sIdentifier = "") +: meType(eType) +, msName(sName) +, msAbbreviatedName(sAbbreviatedName) +, msIdentifier(sIdentifier) +{ +} + +/// Returns the text to display, which is the Abbreviated Name, if provided, otherwise Name. +OUString getDisplayText() const +{ +return !msAbbreviatedName.isEmpty() ? msAbbreviatedName : msName; +} + +bool operator==(const ClassificationResult& rOther) const +{ +return (meType == rOther.meType && +msName == rOther.msName && +msAbbreviatedName == rOther.msAbbreviatedName && +msIdentifier == rOther.msIdentifier); +} +}; + class SVX_DLLPUBLIC ClassificationField : public SvxFieldData { public: @@ -60,14 +92,6 @@ public: } }; -struct SVX_DLLPUBLIC ClassificationResult -{ -ClassificationType meType; -OUString msString; //< Display text or 'Name' field (from example.xml). -OUString msAbbreviatedString; //< Abbreviated name, displayed instead of msString. -OUString msIdentifier; //< The identifier of this entry (from example.xml). -}; - } // end svx namespace #endif // INCLUDED_SVX_CLASSIFICATIONFIELD_HXX diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 992e6608f961..3ccbe562ccf8 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -470,7 +470,7 @@ public: for (svx::ClassificationResult const & rResult : rResults) { if (rResult.meType == svx::ClassificationType::CATEGORY) -aHelper.SetBACName(rResult.msString, SfxClassificationHelper::getPolicyType()); +aHelper.SetBACName(rResult.msName, SfxClassificationHelper::getPolicyType()); } sfx::ClassificationKeyCreator aKeyCreator(SfxClassificationHelper::getPolicyType()); @@ -491,31 +491,31 @@ public: case svx::ClassificationType::TEXT: { OUString sKey = aKeyCreator.makeNumberedMarkingTextKey(); -addOrInsertDocumentProperty(xPropertyContainer, sKey, rResult.msString); - pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msString), EE_FEATURE_FIELD), aPosition); +addOrInsertDocumentProperty(xPropertyContainer, sKey, rResult.msName); + pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msName), EE_FEATURE_FIELD), aPosition); } break; case svx::ClassificationType::CATEGORY: { OUString sKey = aKeyCreator.makeCategoryKey(); - pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msString), EE_FEATURE_FIELD), aPosition); + pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msName), EE_FEATURE_FIELD), aPosition); } break; case svx::ClassificationType::MARKING: { OUString sKey = aKeyCreator.makeMarkingKey(); -addOrInsertDocumentProperty(xPropertyContainer, sKey, rResult.msString); - pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msString), EE_FEATURE_FIELD), aPosition); +addOrInsertDocumentProperty(xPropertyContainer, sKey, rResult.m
[Libreoffice-commits] core.git: include/svx sd/source svx/source sw/source
include/svx/ClassificationField.hxx |4 sd/source/ui/view/drviews2.cxx | 55 +- svx/source/dialog/ClassificationDialog.cxx | 48 + svx/source/dialog/ClassificationEditView.cxx | 24 +- sw/source/core/edit/edfcol.cxx | 221 +-- 5 files changed, 255 insertions(+), 97 deletions(-) New commits: commit 73f57984110a3c5bb19168dd0789c0c3c809b24e Author: Tomaž Vajngerl Date: Fri Oct 27 16:03:52 2017 +0900 TSCP: proper collecting and applying of paragraph and text weight Change-Id: I22edc4adb87706a176c3afa3500963c4a5b46ee7 Reviewed-on: https://gerrit.libreoffice.org/44015 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/svx/ClassificationField.hxx b/include/svx/ClassificationField.hxx index 559ed66511d8..b57f29cbafbe 100644 --- a/include/svx/ClassificationField.hxx +++ b/include/svx/ClassificationField.hxx @@ -22,7 +22,8 @@ enum class ClassificationType CATEGORY, MARKING, TEXT, -INTELLECTUAL_PROPERTY_PART +INTELLECTUAL_PROPERTY_PART, +PARAGRAPH, }; class SVX_DLLPUBLIC ClassificationField : public SvxFieldData @@ -61,7 +62,6 @@ struct SVX_DLLPUBLIC ClassificationResult ClassificationType meType; OUString msString; OUString msAbbreviatedString; -sal_Int32 mnParagraph; }; } // end svx namespace diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 49706a9cdd0d..e96a69db7c60 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -299,7 +299,6 @@ public: const sal_uInt16 nCount = m_rDrawViewShell.GetDoc()->GetMasterSdPageCount(PageKind::Standard); -sal_Int32 nParagraph = 1; bool bFound = false; for (sal_uInt16 nPageIndex = 0; nPageIndex < nCount; ++nPageIndex) @@ -323,8 +322,34 @@ public: bFound = true; m_pRectObject = pRectObject; const OUString sBlank(""); +sal_Int32 nCurrentParagraph = -1; + for (editeng::Section const & rSection : aSections) { +// Insert new paragraph if needed +while (nCurrentParagraph < rSection.mnParagraph) +{ +nCurrentParagraph++; + +// Get Weight of current paragraph +FontWeight eFontWeight = WEIGHT_NORMAL; +SfxItemSet aItemSet(rEditText.GetParaAttribs(nCurrentParagraph)); +if (const SfxPoolItem* pItem = aItemSet.GetItem(EE_CHAR_WEIGHT, false)) +{ +const SvxWeightItem* pWeightItem = dynamic_cast(pItem); +if (pWeightItem && pWeightItem->GetWeight() == WEIGHT_BOLD) +eFontWeight = WEIGHT_BOLD; +} + +// Font weight to string +OUString sWeightProperty = "NORMAL"; +if (eFontWeight == WEIGHT_BOLD) +sWeightProperty = "BOLD"; + +// Insert into collection +m_aResults.push_back({ svx::ClassificationType::PARAGRAPH, sWeightProperty, sBlank }); +} + const SvxFieldItem* pFieldItem = findField(rSection); const editeng::CustomPropertyField* pCustomPropertyField = pFieldItem ? dynamic_cast(pFieldItem->GetField()) : nullptr; if (pCustomPropertyField) @@ -333,22 +358,22 @@ public: if (aKey.startsWith(sPolicy + "Marking:Text:")) { OUString aValue = lcl_getProperty(xPropertyContainer, aKey); -m_aResults.push_back({ svx::ClassificationType::TEXT, aValue, sBlank, nParagraph }); +m_aResults.push_back({ svx::ClassificationType::TEXT, aValue, sBlank }); } else if (aKey.startsWith(sPolicy + "BusinessAuthorizationCategory:Name")) { OUString aValue = lcl_getProperty(xPropertyContainer, aKey); -m_aResults.push_back({ svx::ClassificationType::CATEGORY, aValue, sBlank, nParagraph }); +m_aResults.push_back({ svx::ClassificationTy
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/AffineMatrixItem.hxx |3 include/svx/xbtmpit.hxx |3 include/svx/xcolit.hxx |3 include/svx/xflclit.hxx |2 include/svx/xflgrit.hxx |3 include/svx/xflhtit.hxx |3 include/svx/xftshcit.hxx |2 include/svx/xit.hxx |3 include/svx/xlnclit.hxx |2 include/svx/xlndsit.hxx |3 include/svx/xlnedit.hxx |3 include/svx/xlnstit.hxx |3 include/svx/xsflclit.hxx |2 sd/source/ui/func/fupage.cxx |2 svx/source/xoutdev/xattr.cxx | 406 --- svx/source/xoutdev/xattr2.cxx| 27 -- svx/source/xoutdev/xattrbmp.cxx | 23 -- 17 files changed, 1 insertion(+), 492 deletions(-) New commits: commit 97b889b8b2b2554ce33fd6b3f0359fc18f39832d Author: Varun Dhall Date: Tue Aug 1 10:36:45 2017 +0530 WIP: Removing unused SfxItemPool serialisation from svx Change-Id: I3222033fadd688959fd55e3f335540054fc418f4 Reviewed-on: https://gerrit.libreoffice.org/40612 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/svx/AffineMatrixItem.hxx b/include/svx/AffineMatrixItem.hxx index 872e3f7eb9d7..dad733a33b50 100644 --- a/include/svx/AffineMatrixItem.hxx +++ b/include/svx/AffineMatrixItem.hxx @@ -35,14 +35,11 @@ private: public: AffineMatrixItem(const css::geometry::AffineMatrix2D* pMatrix); -AffineMatrixItem(SvStream& rIn); AffineMatrixItem(const AffineMatrixItem&); virtual ~AffineMatrixItem() override; virtual bool operator==(const SfxPoolItem&) const override; virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override; -virtual SfxPoolItem* Create( SvStream& rIn, sal_uInt16 nVer ) const override; -virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; diff --git a/include/svx/xbtmpit.hxx b/include/svx/xbtmpit.hxx index 0180e3dbd0e0..48e14836cd0d 100644 --- a/include/svx/xbtmpit.hxx +++ b/include/svx/xbtmpit.hxx @@ -49,12 +49,9 @@ public: XFillBitmapItem(const OUString& rName, const GraphicObject& rGraphicObject); XFillBitmapItem( const GraphicObject& rGraphicObject ); XFillBitmapItem( const XFillBitmapItem& rItem ); -XFillBitmapItem( SvStream& rIn, sal_uInt16 nVer ); virtual booloperator==( const SfxPoolItem& rItem ) const override; virtual SfxPoolItem*Clone( SfxItemPool* pPool = nullptr ) const override; -virtual SfxPoolItem*Create( SvStream& rIn, sal_uInt16 nVer ) const override; -virtual SvStream& Store( SvStream& rOut, sal_uInt16 nItemVersion ) const override; virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const override; virtual boolQueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; diff --git a/include/svx/xcolit.hxx b/include/svx/xcolit.hxx index 3acdf0f00f0c..df3723542516 100644 --- a/include/svx/xcolit.hxx +++ b/include/svx/xcolit.hxx @@ -44,13 +44,10 @@ public: XColorItem(sal_uInt16 nWhich, const Color& rTheColor); XColorItem(sal_uInt16 nWhich, const OUString& rName, const Color& rTheColor); -XColorItem(sal_uInt16 nWhich, SvStream& rIn); XColorItem(const XColorItem& rItem); virtual booloperator==(const SfxPoolItem& rItem) const override; virtual SfxPoolItem*Clone(SfxItemPool* pPool = nullptr) const override; -virtual SfxPoolItem*Create(SvStream& rIn, sal_uInt16 nVer) const override; -virtual SvStream& Store(SvStream& rOut, sal_uInt16 nItemVersion ) const override; const Color&GetColorValue() const; voidSetColorValue(const Color& rNew) { aColor = rNew; Detach(); } diff --git a/include/svx/xflclit.hxx b/include/svx/xflclit.hxx index c3ea60c41f0f..820e574bbaf4 100644 --- a/include/svx/xflclit.hxx +++ b/include/svx/xflclit.hxx @@ -37,10 +37,8 @@ public: XFillColorItem() {} XFillColorItem(sal_Int32 nIndex, const Color& rTheColor); XFillColorItem(const OUString& rName, const Color& rTheColor); -XFillColorItem(SvStream& rIn); virtual SfxPoolItem*Clone(SfxItemPool* pPool = nullptr) const override; -virtual SfxPoolItem*Create(SvStream& rIn, sal_uInt16 nVer) const override; virtual boolQueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual boolPutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; diff --git a/include/svx/xflgrit.hxx b/include/svx/xflgrit.hxx index 12127adf32a5..70abe25edb3b 100644 --- a/include/svx/xflgrit.hxx +++ b/include/svx/
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/scene3d.hxx |5 +--- include/svx/sdasitm.hxx |2 - include/svx/sphere3d.hxx |3 +- sd/source/ui/func/fucon3d.cxx |2 - svx/source/customshapes/EnhancedCustomShape3d.cxx |2 - svx/source/dialog/dlgctl3d.cxx|2 - svx/source/engine3d/obj3d.cxx |4 +-- svx/source/engine3d/objfac3d.cxx |2 - svx/source/engine3d/scene3d.cxx | 23 +- svx/source/engine3d/sphere3d.cxx |2 - svx/source/engine3d/view3d.cxx|5 +--- svx/source/items/customshapeitem.cxx | 18 ++--- 12 files changed, 22 insertions(+), 48 deletions(-) New commits: commit 97f391d4e5ed89425ca6c5ad52d159a7ce8fdee2 Author: Noel Grandin Date: Thu May 4 11:23:54 2017 +0200 loplugin:checkunusedparams in svx(part1) Change-Id: Ie98ec3be5ece2579feca050563c5ab7776ad6a7e Reviewed-on: https://gerrit.libreoffice.org/37227 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx index 25a230089b79..83ecca16b1f5 100644 --- a/include/svx/scene3d.hxx +++ b/include/svx/scene3d.hxx @@ -83,13 +83,12 @@ protected: virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override; protected: -void SetDefaultAttributes(E3dDefaultAttributes& rDefault); +void SetDefaultAttributes(); void ImpCleanup3DDepthMapper(); public: E3dScene(); -E3dScene(E3dDefaultAttributes& rDefault); virtual ~E3dScene() override; virtual void SetBoundRectDirty() override; @@ -140,7 +139,7 @@ public: virtual void SetTransform(const basegfx::B3DHomMatrix& rMatrix) override; virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override; -void RotateScene(const Point& rRef, long nAngle, double sn, double cs); +void RotateScene(const Point& rRef, double sn, double cs); // TakeObjName...() is for the display in the UI, for example "3 frames selected". virtual OUString TakeObjNameSingul() const override; diff --git a/include/svx/sdasitm.hxx b/include/svx/sdasitm.hxx index 43a5f36c59b6..57e1e20d3adc 100644 --- a/include/svx/sdasitm.hxx +++ b/include/svx/sdasitm.hxx @@ -51,10 +51,8 @@ private: public: - SdrCustomShapeGeometryItem(); SdrCustomShapeGeometryItem( const css::uno::Sequence< css::beans::PropertyValue >& ); -SdrCustomShapeGeometryItem( SvStream& rIn, sal_uInt16 nVersion ); virtual ~SdrCustomShapeGeometryItem() override; virtual booloperator==( const SfxPoolItem& ) const override; diff --git a/include/svx/sphere3d.hxx b/include/svx/sphere3d.hxx index c0ba4bbf8ceb..c612080185bc 100644 --- a/include/svx/sphere3d.hxx +++ b/include/svx/sphere3d.hxx @@ -44,7 +44,8 @@ public: // FG: This constructor is only called from MakeObject from the 3d-Objectfactory // when a document with a sphere is loaded. This constructor does not call // CreateSphere, or create any spheres. -E3dSphereObj(int dummy); +enum Dummy { DUMMY }; +E3dSphereObj(Dummy dummy); // horizontal segments: sal_uInt32 GetHorizontalSegments() const diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx index dfbb806136b6..1d12e5bf85fb 100644 --- a/sd/source/ui/func/fucon3d.cxx +++ b/sd/source/ui/func/fucon3d.cxx @@ -373,7 +373,7 @@ SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const double fW(aVolume.getWidth()); double fH(aVolume.getHeight()); ::tools::Rectangle a3DRect(0, 0, (long)fW, (long)fH); -E3dScene* pScene = new E3dScene(mpView->Get3DDefaultAttributes()); +E3dScene* pScene = new E3dScene; // copied code from E3dView::InitScene double fCamZ(aVolume.getMaxZ() + ((fW + fH) / 4.0)); diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index 6989760ad093..da6ad1357d8c 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -326,7 +326,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con a3DDefaultAttr.SetDefaultLatheCharacterMode( true ); a3DDefaultAttr.SetDefaultExtrudeCharacterMode( true ); -E3dScene* pScene = new E3dScene( a3DDefaultAttr ); +E3dScene* pScene = new E3dScene; bool bSceneHasObjects ( false ); bool bUseTwoFillStyles( false ); diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 4c704e318eee..258fe69f1c4a 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -97,7 +97,7 @@ void Svx3DPreviewControl::Construct() mp3DView->SetBufferedOver
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/polypolygoneditor.hxx |3 +-- sd/source/ui/animations/motionpathtag.cxx |6 +++--- svx/source/svdraw/polypolygoneditor.cxx |6 +++--- svx/source/svdraw/svdpoev.cxx |6 +++--- 4 files changed, 10 insertions(+), 11 deletions(-) New commits: commit c10aaf94a9054e48ddd1112c84876eecd3dec726 Author: Regina Henschel Date: Sun Jan 29 01:03:16 2017 +0100 tdf#105545 Allow closed paths having 2 points Closed paths with 2 points can be created from scratch, therefore allow them too, if a point is deleted. Remove now unused member mbIsClosed Change-Id: Iac2a08df52f734c99c6ac14d9f1a16d8b943d399 Reviewed-on: https://gerrit.libreoffice.org/33654 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/include/svx/polypolygoneditor.hxx b/include/svx/polypolygoneditor.hxx index a65200fd3ad2..c5b079d707c8 100644 --- a/include/svx/polypolygoneditor.hxx +++ b/include/svx/polypolygoneditor.hxx @@ -34,7 +34,7 @@ namespace sdr class SVX_DLLPUBLIC PolyPolygonEditor { public: -PolyPolygonEditor( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed ); +PolyPolygonEditor( const basegfx::B2DPolyPolygon& rPolyPolygon); const basegfx::B2DPolyPolygon& GetPolyPolygon() const { return maPolyPolygon; } @@ -58,7 +58,6 @@ public: private: basegfx::B2DPolyPolygon maPolyPolygon; -bool mbIsClosed; }; } diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 39369192911d..4ce9ad62bc66 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -1036,7 +1036,7 @@ void MotionPathTag::DeleteMarkedPoints() mrView.BrkAction(); SdrUShortCont& rPts = mpMark->GetMarkedPoints(); -PolyPolygonEditor aEditor( mpPathObj->GetPathPoly(), mpPathObj->IsClosed() ); +PolyPolygonEditor aEditor( mpPathObj->GetPathPoly()); if (aEditor.DeletePoints(rPts)) { if( aEditor.GetPolyPolygon().count() ) @@ -1088,7 +1088,7 @@ void MotionPathTag::SetMarkedSegmentsKind(SdrPathSegmentKind eKind) if(mpPathObj && isSelected() && (GetMarkedPointCount() != 0)) { SdrUShortCont& rPts = mpMark->GetMarkedPoints(); -PolyPolygonEditor aEditor( mpPathObj->GetPathPoly(), mpPathObj->IsClosed() ); +PolyPolygonEditor aEditor( mpPathObj->GetPathPoly() ); if (aEditor.SetSegmentsKind(eKind, rPts)) { mpPathObj->SetPathPoly(aEditor.GetPolyPolygon()); @@ -1138,7 +1138,7 @@ void MotionPathTag::SetMarkedPointsSmooth(SdrPathSmoothKind eKind) if(mpPathObj && mpMark && isSelected() && (GetMarkedPointCount() != 0)) { SdrUShortCont& rPts = mpMark->GetMarkedPoints(); -PolyPolygonEditor aEditor( mpPathObj->GetPathPoly(), mpPathObj->IsClosed() ); +PolyPolygonEditor aEditor( mpPathObj->GetPathPoly()); if (aEditor.SetPointsSmooth(eFlags, rPts)) { mpPathObj->SetPathPoly(aEditor.GetPolyPolygon()); diff --git a/svx/source/svdraw/polypolygoneditor.cxx b/svx/source/svdraw/polypolygoneditor.cxx index 9fab1ba153f3..3cdd3c799231 100644 --- a/svx/source/svdraw/polypolygoneditor.cxx +++ b/svx/source/svdraw/polypolygoneditor.cxx @@ -25,9 +25,8 @@ namespace sdr { -PolyPolygonEditor::PolyPolygonEditor( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed ) +PolyPolygonEditor::PolyPolygonEditor( const basegfx::B2DPolyPolygon& rPolyPolygon) : maPolyPolygon( rPolyPolygon ) -, mbIsClosed( bClosed ) { } @@ -46,7 +45,8 @@ bool PolyPolygonEditor::DeletePoints( const std::set< sal_uInt16 >& rAbsPoints ) aCandidate.remove(nPnt); -if( ( mbIsClosed && aCandidate.count() < 3L) || (aCandidate.count() < 2L) ) + +if( aCandidate.count() < 2L ) { maPolyPolygon.remove(nPoly); } diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx index 77185149eafb..9d259ab4f319 100644 --- a/svx/source/svdraw/svdpoev.cxx +++ b/svx/source/svdraw/svdpoev.cxx @@ -207,7 +207,7 @@ void SdrPolyEditView::SetMarkedPointsSmooth(SdrPathSmoothKind eKind) continue; SdrUShortCont& rPts = pM->GetMarkedPoints(); -PolyPolygonEditor aEditor(pPath->GetPathPoly(), pPath->IsClosed()); +PolyPolygonEditor aEditor(pPath->GetPathPoly()); if (aEditor.SetPointsSmooth(eFlags, rPts)) { if( bUndo ) @@ -240,7 +240,7 @@ void SdrPolyEditView::SetMarkedSegmentsKind(SdrPathSegmentKind eKind) if (!pPath) continue; SdrUShortCont& rPts = pM->GetMarkedPoints(); -PolyPolygonEditor aEditor( pPath->GetPathPoly(), pPath->IsClosed() ); +PolyPolygonEditor aEditor( pPath->GetPathPoly()); if (aEditor.SetSegmentsKind(eKind, rPts)) {
[Libreoffice-commits] core.git: include/svx sd/source svx/source sw/source
include/svx/sdr/contact/viewcontact.hxx|4 - include/svx/sdr/contact/viewcontactofsdrobj.hxx|2 include/svx/sdr/contact/viewobjectcontact.hxx |2 sd/source/core/CustomAnimationEffect.cxx |2 sd/source/ui/animations/motionpathtag.cxx |2 svx/source/sdr/contact/viewcontact.cxx |2 svx/source/sdr/contact/viewcontactofgroup.cxx |2 svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx |2 svx/source/sdr/contact/viewcontactofsdrpage.cxx| 22 +- svx/source/sdr/contact/viewcontactofvirtobj.cxx|2 svx/source/sdr/contact/viewobjectcontact.cxx |2 svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx |2 svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx |2 svx/source/sdr/primitive2d/primitivefactory2d.cxx |4 - svx/source/svdraw/svdcrtv.cxx |2 svx/source/svdraw/svdobj.cxx |6 +- svx/source/svdraw/svdotxtr.cxx |2 svx/source/svdraw/svdxcgv.cxx |2 sw/source/core/draw/dcontact.cxx |4 - 19 files changed, 34 insertions(+), 34 deletions(-) New commits: commit 0b2801922d6972eeb607e37a8a1de210e825c95e Author: Noel Grandin Date: Wed Nov 30 11:12:39 2016 +0200 rename getViewIndependentPrimitive2DSequence.. to getViewIndependentPrimitive2DContainer to match it's new return type Change-Id: I767bdef45316e355d49f6509ca1b50138a45b3fa diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx index 8e1a882..2034712 100644 --- a/include/svx/sdr/contact/viewcontact.hxx +++ b/include/svx/sdr/contact/viewcontact.hxx @@ -122,13 +122,13 @@ public: // access to the local primitive. This will ensure that the primitive is // current in comparing the local one with a fresh created incarnation -drawinglayer::primitive2d::Primitive2DContainer const & getViewIndependentPrimitive2DSequence() const; +drawinglayer::primitive2d::Primitive2DContainer const & getViewIndependentPrimitive2DContainer() const; // add Gluepoints (if available) virtual drawinglayer::primitive2d::Primitive2DContainer createGluePointPrimitive2DSequence() const; // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This -// is a helper normally used from getViewIndependentPrimitive2DSequence(), but there is one exception +// is a helper normally used from getViewIndependentPrimitive2DContainer(), but there is one exception // for 3D scenes virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DContainer& rSource) const; diff --git a/include/svx/sdr/contact/viewcontactofsdrobj.hxx b/include/svx/sdr/contact/viewcontactofsdrobj.hxx index 81583a7..039bf43 100644 --- a/include/svx/sdr/contact/viewcontactofsdrobj.hxx +++ b/include/svx/sdr/contact/viewcontactofsdrobj.hxx @@ -75,7 +75,7 @@ public: virtual drawinglayer::primitive2d::Primitive2DContainer createGluePointPrimitive2DSequence() const override; // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This -// is a helper normally used from getViewIndependentPrimitive2DSequence(), but there is one exception +// is a helper normally used from getViewIndependentPrimitive2DContainer(), but there is one exception // for 3D scenes virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DContainer& rSource) const override; }; diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx b/include/svx/sdr/contact/viewobjectcontact.hxx index 11ad3d8..b5b1a35 100644 --- a/include/svx/sdr/contact/viewobjectcontact.hxx +++ b/include/svx/sdr/contact/viewobjectcontact.hxx @@ -71,7 +71,7 @@ protected: // This method is responsible for creating the graphical visualisation data which is // stored/cached in the local primitive. Default gets view-independent Primitive -// from the ViewContact using ViewContact::getViewIndependentPrimitive2DSequence(), takes care of +// from the ViewContact using ViewContact::getViewIndependentPrimitive2DContainer(), takes care of // visibility, handles glue and ghosted. // This method will not handle included hierarchies and not check geometric visibility. virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; diff --git a/sd/source/
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdmark.hxx | 36 -- sd/source/ui/animations/motionpathtag.cxx | 67 +--- svx/source/svdraw/svddrgmt.cxx| 21 - svx/source/svdraw/svdglev.cxx | 34 +- svx/source/svdraw/svdmark.cxx | 64 svx/source/svdraw/svdmrkv.cxx | 48 +-- svx/source/svdraw/svdmrkv1.cxx| 94 +++--- svx/source/svdraw/svdpoev.cxx | 409 ++ 8 files changed, 337 insertions(+), 436 deletions(-) New commits: commit 8bff616ae65f67f2eb2e6b81f1dbbbe2f9f7f5d9 Author: Caolán McNamara Date: Tue Nov 8 10:25:25 2016 + simplify mark points and gluepoints management Change-Id: I52070cfe4909a13189d9c130114d98565ced9089 diff --git a/include/svx/svdmark.hxx b/include/svx/svdmark.hxx index 0771489..39a5eb3 100644 --- a/include/svx/svdmark.hxx +++ b/include/svx/svdmark.hxx @@ -48,8 +48,8 @@ protected: sal_Int64 mnTimeStamp; SdrObject* mpSelectedSdrObject; // the selected object SdrPageView*mpPageView; -SdrUShortCont* mpPoints; // Selected Points -SdrUShortCont* mpGluePoints; // Selected Gluepoints (their Id's) +SdrUShortCont maPoints; // Selected Points +SdrUShortCont maGluePoints; // Selected Gluepoints (their Id's) boolmbCon1; // for Connectors boolmbCon2; // for Connectors sal_uInt16 mnUser; // E.g. for CopyObjects, also copy Edges @@ -107,40 +107,24 @@ public: return mnUser; } -const SdrUShortCont* GetMarkedPoints() const +const SdrUShortCont& GetMarkedPoints() const { -return mpPoints; +return maPoints; } -const SdrUShortCont* GetMarkedGluePoints() const +const SdrUShortCont& GetMarkedGluePoints() const { -return mpGluePoints; +return maGluePoints; } -SdrUShortCont* GetMarkedPoints() +SdrUShortCont& GetMarkedPoints() { -return mpPoints; +return maPoints; } -SdrUShortCont* GetMarkedGluePoints() +SdrUShortCont& GetMarkedGluePoints() { -return mpGluePoints; -} - -SdrUShortCont* ForceMarkedPoints() -{ -if(!mpPoints) -mpPoints = new SdrUShortCont; - -return mpPoints; -} - -SdrUShortCont* ForceMarkedGluePoints() -{ -if(!mpGluePoints) -mpGluePoints = new SdrUShortCont; - -return mpGluePoints; +return maGluePoints; } sal_Int64 getTimeStamp() const diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index da51c1e..cbf0a7f 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -775,8 +775,8 @@ sal_uLong MotionPathTag::GetMarkedPointCount() const { if( mpMark ) { -const SdrUShortCont* pPts=mpMark->GetMarkedPoints(); -return pPts ? pPts->size() : 0; +const SdrUShortCont& rPts = mpMark->GetMarkedPoints(); +return rPts.size(); } else { @@ -792,7 +792,6 @@ bool MotionPathTag::MarkPoint(SdrHdl& rHdl, bool bUnmark ) SmartHdl* pSmartHdl = dynamic_cast< SmartHdl* >( &rHdl ); if( pSmartHdl && pSmartHdl->getTag().get() == this ) { -mpMark->ForceMarkedPoints(); if (mrView.MarkPointHelper(&rHdl,mpMark,bUnmark)) { mrView.MarkListHasChanged(); @@ -907,7 +906,7 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList ) { SdrHdlList aTemp( rHandlerList.GetView() ); mpPathObj->AddToHdlList( aTemp ); -const SdrUShortCont* pMrkPnts=mpMark->GetMarkedPoints(); +const SdrUShortCont& rMrkPnts = mpMark->GetMarkedPoints(); for( size_t nHandle = 0; nHandle < aTemp.GetHdlCount(); ++nHandle ) { @@ -923,7 +922,7 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList ) rHandlerList.AddHdl( pSmartHdl ); -const bool bSelected= pMrkPnts && pMrkPnts->find( sal_uInt16(nHandle) ) != pMrkPnts->end(); +const bool bSelected = rMrkPnts.find( sal_uInt16(nHandle) ) != rMrkPnts.end(); pSmartHdl->SetSelected(bSelected); if( mrView.IsPlusHandlesAlwaysVisible() || bSelected ) @@ -1016,10 +1015,8 @@ void MotionPathTag::deselect() if( mpMark ) { -SdrUShortCont* pPts = mpMark->GetMarkedPoints(); - -if( pPts ) -
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdpagv.hxx |7 --- sd/source/ui/func/fusel.cxx |2 - sd/source/ui/func/futext.cxx |2 - svx/source/svdraw/svdmrkv.cxx | 29 svx/source/svdraw/svdpagv.cxx | 74 +- 5 files changed, 35 insertions(+), 79 deletions(-) New commits: commit a87a31602165cb2a37c32f5928e4f9daade7271d Author: Jochen Nitschke Date: Tue Aug 2 14:30:09 2016 +0200 merge SdrPageView::IsObjSelectable and SdrPageView::IsObjMarkable These member functions have the same purpose and share same functionality in great parts. The checks are rewritten for better readability and merged into IsObjMarkable. This adds IsInserted and a same page check to the function. Tested selection of nested grouped objects. Tested selection of objects in front of objects on master pages. The fix for #i43302# doesn't seem nessasary (saw no way to create empty groups) but leaving it on for now. Change-Id: I35d84c66dfd832d626ba2700f22d4c437593cac7 Reviewed-on: https://gerrit.libreoffice.org/27786 Reviewed-by: Jochen Nitschke Tested-by: Jochen Nitschke diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx index e410b43..98bd49e 100644 --- a/include/svx/svdpagv.hxx +++ b/include/svx/svdpagv.hxx @@ -232,14 +232,9 @@ public: /// At least one member must be visible for the Group object and /// it must not be locked /// @returns -// true, if the object's layer is visible and not locked +/// true, if the object's layer is visible and not locked bool IsObjMarkable(SdrObject* pObj) const; -/// Hmm, selectable is surely the same as markable, now that I -/// see this as I look for a place to put it. -/// TODO: merge these -bool IsObjSelectable(SdrObject *pObj) const; - /// Entering (editing) an object group /// After that, we have direct access to all member objects of the group. /// All other objects are not editable in the meantime (until the next diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 6ba4695..007cb96 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -673,7 +673,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) SdrObject* pObj; if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK)) { -if (pPV->IsObjSelectable(pObj)) +if (pPV->IsObjMarkable(pObj)) { mpView->UnmarkAllObj(); mpView->MarkObj(pObj,pPV); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 9b0979b..6ae69e7 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -660,7 +660,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) SdrPageView* pPV; if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK)) { -if (pPV->IsObjSelectable(pObj)) +if (pPV->IsObjMarkable(pObj)) { mpView->UnmarkAllObj(); mpView->MarkObj(pObj,pPV); diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 3cc3836..5c66491 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -1270,33 +1270,6 @@ SfxViewShell* SdrMarkView::GetSfxViewShell() const return SfxViewShell::Current(); } -bool SdrPageView::IsObjSelectable(SdrObject *pObj) const -{ -SdrLayerID nLay=pObj->GetLayer(); -bool bRaus=!pObj->IsInserted(); // Obj deleted? -if (!pObj->Is3DObj()) { -bRaus=bRaus || pObj->GetPage()!=GetPage(); // Obj suddenly in different Page or Group -} -bRaus=bRaus || GetLockedLayers().IsSet(nLay) || // Layer locked? - !GetVisibleLayers().IsSet(nLay); // Layer invisible? - -if( !bRaus ) -bRaus = !pObj->IsVisible(); // invisible objects can not be selected - -if (!bRaus) { -// Grouped objects can now be selected. -// After EnterGroup the higher-level objects, -// have to be deselected, though. -const SdrObjList* pOOL=pObj->GetObjList(); -const SdrObjList* pVOL=GetObjList(); -while (pOOL!=nullptr && pOOL!=pVOL) { -pOOL=pOOL->GetUpList(); -} -bRaus=pOOL!=pVOL; -} -return !bRaus; -} - void SdrMarkView::CheckMarked() { for (size_t nm=GetMarkedObjectCount(); nm>0;) { @@ -1304,7 +1277,7 @@ void SdrMarkView::CheckMarked() SdrMark* pM = GetSdrMarkByIndex(nm); SdrObject* pObj = pM->GetMarkedSdrObj(); SdrPageView* pPV = pM->GetPageView(); -bool bRaus = !pObj || !pPV->IsObjSelectable(pObj); +bool bRaus = !pObj |
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdedxv.hxx |4 sd/source/ui/inc/View.hxx |1 + sd/source/ui/view/sdview.cxx | 10 ++ svx/source/svdraw/svdedxv.cxx | 14 +- 4 files changed, 28 insertions(+), 1 deletion(-) New commits: commit c0f1c0da77cf9f148b3f29aaf0965dfb43b8a32c Author: Miklos Vajna Date: Wed Jul 27 10:03:28 2016 +0200 svx lok: avoid SfxViewShell::Current() during constructing a new view shell Currently when a text edit is started, then in the LOK case if there is an other view that shows the same page, then both draw views will have an outliner view showing the text edit. This means that in case a view shell is created after starting the text edit, that won't have an outliner view for the text edit. Before fixing this, calls to SfxViewShell::Current() has to be avoided when we're in the process of setting up a new LOK view. In case of Impress, this is a double initialization, and by the time SdrObjEditView::ImpMakeOutlinerView() is called, we're already in the process of setting up the second SfxViewShell (as part of SdXImpressDocument::initializeForTiledRendering()), but SfxViewShell::Current() still points to the old view shell. Which means that the outliner view would refer to a view shell that's deleted soon, and we crash as soon as it tries to invoke a LOK callback. Fix this by adding a virtual member function to SdrObjEditView, and override it in sd, so in case applications want to provide a more precise way of giving the view shell owning a draw view, then they can. Change-Id: Ie0005f73237d4ff9cf576bf16fa5b46280f13759 Reviewed-on: https://gerrit.libreoffice.org/27561 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index 4aac4ff..70ffe3b 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -35,6 +35,7 @@ class ImpSdrEditPara; struct PasteOrDropInfos; class SdrUndoManager; class TextChainCursorManager; +class SfxViewShell; namespace com { namespace sun { namespace star { namespace uno { class Any; @@ -155,6 +156,9 @@ public: virtual void BckAction() override; virtual void TakeActionRect(Rectangle& rRect) const override; +/// Get access to the view shell owning this draw view, if any. +virtual SfxViewShell* GetSfxViewShell() const; + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; virtual void ModelHasChanged() override; diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index c1b97b3..c1f52ac 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -122,6 +122,7 @@ public: inline DrawDocShell* GetDocSh() const { return mpDocSh; } inline SdDrawDocument& GetDoc() const; inline ViewShell* GetViewShell() const { return mpViewSh; } +SfxViewShell* GetSfxViewShell() const override; virtual bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = nullptr, vcl::Window* pWin = nullptr, bool bIsNewObj = false, SdrOutliner* pGivenOutliner = nullptr, OutlinerView* pGivenOutlinerView = nullptr, diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 5e097dd..ddaf809 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -651,6 +651,16 @@ void OutlinerMasterViewFilter::End() } } +SfxViewShell* View::GetSfxViewShell() const +{ +SfxViewShell* pRet = nullptr; + +if (mpViewSh) +pRet = &mpViewSh->GetViewShellBase(); + +return pRet; +} + bool View::SdrBeginTextEdit( SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin, bool bIsNewObj, diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 9a458806..cd6e083 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -142,6 +142,11 @@ void SdrObjEditView::TakeActionRect(Rectangle& rRect) const } } +SfxViewShell* SdrObjEditView::GetSfxViewShell() const +{ +return nullptr; +} + void SdrObjEditView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) { SdrGlueEditView::Notify(rBC,rHint); @@ -461,7 +466,14 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, bool /*bNoP } pOutlView->SetControlWord(nStat); pOutlView->SetBackgroundColor( aBackground ); -pOutlView->registerLibreOfficeKitViewCallback(SfxViewShell::Current()); + +// In case we're in the process of constructing a new view shell, +// SfxViewShell::Current() may still point to the old one. So if possible, +// depend on the application owning this draw view to provide the view +// shell. +SfxViewShell* pSfxViewShell = GetSfxViewShell(); +pOutlView->registerLibreOfficeKitViewCallback(pSfxViewShell ? pSfxViewShell : SfxViewShell::Current()); + if (pText!=nullptr) { pOutlView->SetAnchorMode((EVAnchorMode)(pText->GetOutlinerViewAnch
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdograf.hxx |2 ++ sd/source/ui/view/sdview.cxx |1 - svx/source/svdraw/svdograf.cxx | 29 + 3 files changed, 23 insertions(+), 9 deletions(-) New commits: commit e9fadde3c56a1e8bbb1ffe3ded861fbcd3252407 Author: Gulsah Kose Date: Thu May 26 03:37:37 2016 +0300 tdf#87667 If image is cropped, set cropped size as original size. Change-Id: Ief76037f087a2225442294b972d331fc4476bbec Signed-off-by: Gulsah Kose Reviewed-on: https://gerrit.libreoffice.org/25486 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx index 90027f4..22085c9 100644 --- a/include/svx/svdograf.hxx +++ b/include/svx/svdograf.hxx @@ -138,6 +138,8 @@ public: bool IsEPS() const; bool IsSwappedOut() const; +bool IsCropped() const; + const MapMode& GetGrafPrefMapMode() const; const Size& GetGrafPrefSize() const; diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 3baf250..95c3f56 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -892,7 +892,6 @@ void View::SetMarkedOriginalSize() Rectangle aRect( pObj->GetLogicRect() ); aRect.SetSize( aSize ); pObj->SetLogicRect( aRect ); - bOK = true; } } diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 6655c4f..93a662b 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -531,6 +531,11 @@ bool SdrGrafObj::IsSwappedOut() const return mbIsPreview || pGraphic->IsSwappedOut(); } +bool SdrGrafObj::IsCropped() const +{ +return aGrafInfo.IsCropped(); +} + const MapMode& SdrGrafObj::GetGrafPrefMapMode() const { return pGraphic->GetPrefMapMode(); @@ -561,18 +566,26 @@ OUString SdrGrafObj::GetGrafStreamURL() const Size SdrGrafObj::getOriginalSize() const { -Size aSize; +Size aSize = GetGrafPrefSize(); -if ( GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL ) -aSize = Application::GetDefaultDevice()->PixelToLogic( GetGrafPrefSize(), - GetModel()->GetScaleUnit() ); -else +if (IsCropped()) { -aSize = OutputDevice::LogicToLogic( GetGrafPrefSize(), -GetGrafPrefMapMode(), -GetModel()->GetScaleUnit() ); +long aCroppedTop = OutputDevice::LogicToLogic( aGrafInfo.GetTopCrop(), GetModel()->GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit()); +long aCroppedBottom = OutputDevice::LogicToLogic( aGrafInfo.GetBottomCrop(), GetModel()->GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit()); +long aCroppedLeft = OutputDevice::LogicToLogic( aGrafInfo.GetLeftCrop(), GetModel()->GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit()); +long aCroppedRight = OutputDevice::LogicToLogic( aGrafInfo.GetRightCrop(), GetModel()->GetScaleUnit(), GetGrafPrefMapMode().GetMapUnit()); + +long aCroppedWidth = aSize.getWidth() - aCroppedLeft + aCroppedRight; +long aCroppedHeight = aSize.getHeight() - aCroppedTop + aCroppedBottom; + +aSize = Size ( aCroppedWidth, aCroppedHeight); } +if ( GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL ) +aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, GetModel()->GetScaleUnit() ); +else +aSize = OutputDevice::LogicToLogic( aSize, GetGrafPrefMapMode(), GetModel()->GetScaleUnit() ); + return aSize; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdograf.hxx |1 + sd/source/ui/view/drviews7.cxx | 11 +++ sd/source/ui/view/sdview.cxx | 14 ++ svx/source/svdraw/svdograf.cxx | 17 + 4 files changed, 31 insertions(+), 12 deletions(-) New commits: commit b12354a2de297f05dcdf4602290b56d64675006a Author: Gulsah Kose Date: Wed Apr 20 18:29:07 2016 +0300 tdf#87668 Add control to show or hide "Original Size" option. Change-Id: I022ff86af2e480b061023aac50ff9f79fc6dbf9e Signed-off-by: Gulsah Kose Reviewed-on: https://gerrit.libreoffice.org/24263 Tested-by: Jenkins Reviewed-by: Katarina Behrens diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx index 9e7bf06..90027f4 100644 --- a/include/svx/svdograf.hxx +++ b/include/svx/svdograf.hxx @@ -143,6 +143,7 @@ public: voidSetGrafStreamURL( const OUString& rGraphicStreamURL ); OUStringGetGrafStreamURL() const; +SizegetOriginalSize() const; private: voidForceSwapIn() const; diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 85e7ddb..cd3162e 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1328,6 +1328,17 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) { bSingleGraphicSelected = nMarkCount == 1; const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj); + +// Current size of the OBJ_GRAF +const Rectangle aRect = static_cast(pObj)->GetLogicRect(); +const Size aCurrentSizeofObj = aRect.GetSize(); + +// Original size of the OBJ_GRAF +const Size aOriginalSizeofObj = pSdrGrafObj->getOriginalSize(); + +if(aCurrentSizeofObj == aOriginalSizeofObj ) +rSet.DisableItem(SID_ORIGINAL_SIZE); + switch(pSdrGrafObj->GetGraphicType()) { case GRAPHIC_BITMAP : diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index c6e44d3..c7d8031 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -886,18 +886,8 @@ void View::SetMarkedOriginalSize() } else if( pObj->GetObjIdentifier() == OBJ_GRAF ) { -const MapMode aMap100( MAP_100TH_MM ); -SizeaSize; - -if ( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL ) -aSize = Application::GetDefaultDevice()->PixelToLogic( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefSize(), aMap100 ); -else -{ -aSize = OutputDevice::LogicToLogic( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefSize(), -static_cast< SdrGrafObj* >( pObj )->GetGrafPrefMapMode(), -aMap100 ); -} - +const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj); +const Size aSize = pSdrGrafObj->getOriginalSize( ); pUndoGroup->AddAction( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj ) ); Rectangle aRect( pObj->GetLogicRect() ); aRect.SetSize( aSize ); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 0f2b642..c67599d 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -559,6 +559,23 @@ OUString SdrGrafObj::GetGrafStreamURL() const return pGraphic->GetUserData(); } +Size SdrGrafObj::getOriginalSize() const +{ +Size aSize; + +if ( GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL ) +aSize = Application::GetDefaultDevice()->PixelToLogic( GetGrafPrefSize(), + GetModel()->GetScaleUnit() ); +else +{ +aSize = OutputDevice::LogicToLogic( GetGrafPrefSize(), +GetGrafPrefMapMode(), +GetModel()->GetScaleUnit() ); +} + +return aSize; +} + void SdrGrafObj::ForceSwapIn() const { if( mbIsPreview && pGraphic->HasUserData() ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/scene3d.hxx |2 +- sd/source/ui/func/fucon3d.cxx |2 +- svx/source/customshapes/EnhancedCustomShape3d.cxx |2 +- svx/source/dialog/dlgctl3d.cxx|4 ++-- svx/source/engine3d/scene3d.cxx | 19 +++ 5 files changed, 12 insertions(+), 17 deletions(-) New commits: commit fd6263e37641657f8bf81f42e72c7074263d277d Author: Stephan Bergmann Date: Wed Jan 6 13:22:26 2016 +0100 Make E3dScene3D::GetCamera return non-reference I stumbled over this when Valgrind'ing CppunitTest_sd_filters_test somewhat erroneously reported Source and destination overlap in memcpy(0x2fde4af8, 0x2fde4af8, 96) for aCamera = rNewCamera; in E3dScene::SetCamera (svx/source/engine3d/scene3d.cxx), where the compiler chose to use memcpy in the implicit definition of the Viewport3D (being a base class of Camera3D) copy assignment operator, and the call pattern of Get/SetCamera in EnhancedCustomShape3d::Create3DObject (svx/source/customshapes/EnhancedCustomShape3d.cxx) causes that assignment to be a self-assignment. Upon closer inspection, some calls of GetCamera already create a copy from the returned reference, while others modified the returned reference, but then would also always call SetCamera on it. An alternative to the given change would have been to instead change SetCamera(Camera3D&) to UpdateCamera() and require all call sites of GetCamera/UpdateCamera to modify the reference returned from GetCamera, but it looks safer overall to go this way. Change-Id: I578e72db57630dca1b09124a3b11d177005b797d diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx index f8642e0..70d77e8 100644 --- a/include/svx/scene3d.hxx +++ b/include/svx/scene3d.hxx @@ -126,7 +126,7 @@ public: virtual E3dScene* GetScene() const override; void SetCamera(const Camera3D& rNewCamera); -const Camera3D& GetCamera() const { return aCamera; } +Camera3D GetCamera() const { return aCamera; } void removeAllNonSelectedObjects(); virtual E3dScene* Clone() const override; diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx index 0c27ad0..702d1bd 100644 --- a/sd/source/ui/func/fucon3d.cxx +++ b/sd/source/ui/func/fucon3d.cxx @@ -238,7 +238,7 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape() void FuConstruct3dObject::ImpPrepareBasic3DShape(E3dCompoundObject* p3DObj, E3dScene *pScene) { -Camera3D &aCamera = (Camera3D&) pScene->GetCamera (); +Camera3D aCamera = pScene->GetCamera (); // get transformed BoundVolume of the new object basegfx::B3DRange aBoundVol; diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index 7e2b45e..1f802b8 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -574,7 +574,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con pRet = pScene; // Camera settings, Perspective ... -Camera3D& rCamera = (Camera3D&)pScene->GetCamera(); +Camera3D rCamera = pScene->GetCamera(); const basegfx::B3DRange& rVolume = pScene->GetBoundVolume(); pScene->NbcSetSnapRect( aSnapRect ); diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 2dbd53e..482a89d 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -103,7 +103,7 @@ void Svx3DPreviewControl::Construct() SetObjectType(SvxPreviewObjectType::SPHERE); // camera and perspective -Camera3D& rCamera = (Camera3D&) mpScene->GetCamera(); +Camera3D rCamera = mpScene->GetCamera(); const basegfx::B3DRange& rVolume = mpScene->GetBoundVolume(); double fW = rVolume.getWidth(); double fH = rVolume.getHeight(); @@ -341,7 +341,7 @@ void Svx3DLightControl::Construct2() { // change camera settings -Camera3D& rCamera = (Camera3D&) mpScene->GetCamera(); +Camera3D rCamera = mpScene->GetCamera(); const basegfx::B3DRange& rVolume = mpScene->GetBoundVolume(); double fW = rVolume.getWidth(); double fH = rVolume.getHeight(); diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 911aca6..7ca4871 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -330,31 +330,27 @@ void E3dScene::NbcResize(const Point& rRef, const Fraction& rXFact, void E3dScene::SetCamera(const Camera3D& rNewCamera) { -// Set old camera aCamera = rNewCamera; static_cast(GetProperties()).SetSceneItemsFromCamera(); SetRectsDirty(); -// Fill new camera from old -Camera3D& rCam = (Camera3D&)GetCamera(); - // Turn off ratio -if(r
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdpagv.hxx|2 +- sd/source/ui/inc/DrawViewShell.hxx |1 + sd/source/ui/view/drviews1.cxx |3 +-- sd/source/ui/view/sdwindow.cxx |4 svx/source/svdraw/svdpagv.cxx |5 ++--- 5 files changed, 9 insertions(+), 6 deletions(-) New commits: commit 1631fa9a722553da1ebe0650a65e859862c4405d Author: Miklos Vajna Date: Tue Oct 13 10:46:59 2015 +0200 tdf#95002 sd tiled rendering: fix handling of images on page switch It turns out a full invalidation is still needed to trigger the loading of graphics on the new page, so instead of not invalidating just don't emit the notification about it during page switch. Change-Id: Ic99a3d4e268b3db61cf09c78ed0f310c9d365867 diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx index 04b18f9..48c5b5b 100644 --- a/include/svx/svdpagv.hxx +++ b/include/svx/svdpagv.hxx @@ -221,7 +221,7 @@ public: const SetOfByte& GetLockedLayers() const { return aLayerLock; } const SdrHelpLineList& GetHelpLines() const { return aHelpLines; } -void SetHelpLines(const SdrHelpLineList& rHLL, bool bInvalidate = true); +void SetHelpLines(const SdrHelpLineList& rHLL); //void SetHelpLinePos(sal_uInt16 nNum, const Point& rNewPos); void SetHelpLine(sal_uInt16 nNum, const SdrHelpLine& rNewHelpLine); void DeleteHelpLine(sal_uInt16 nNum); diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 1854d65..971c5dc 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -387,6 +387,7 @@ public: const Color& GetAppBackgroundColor() const { return mnAppBackgroundColor; } void SetAppBackgroundColor( Color nNewColor ) { mnAppBackgroundColor = nNewColor; } +bool IsInSwitchPage() { return mbIsInSwitchPage; } //move this method to ViewShell. //void NotifyAccUpdate(); diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 0ff2d8b..cf146ae 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -992,8 +992,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) } else { -bool bInvalidate = !comphelper::LibreOfficeKit::isActive(); -pNewPageView->SetHelpLines( mpFrameView->GetStandardHelpLines(), bInvalidate ); +pNewPageView->SetHelpLines( mpFrameView->GetStandardHelpLines() ); } } diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 83b65bd..2f53307 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -1006,6 +1006,10 @@ Selection Window::GetSurroundingTextSelection() const void Window::LogicInvalidate(const Rectangle* pRectangle) { +DrawViewShell* pDrawViewShell = dynamic_cast(mpViewShell); +if (pDrawViewShell && pDrawViewShell->IsInSwitchPage()) +return; + OString sRectangle; if (!pRectangle) sRectangle = "EMPTY"; diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index bb7c921..0037771 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -741,11 +741,10 @@ void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt16 nNum) const } } -void SdrPageView::SetHelpLines(const SdrHelpLineList& rHLL, bool bInvalidate) +void SdrPageView::SetHelpLines(const SdrHelpLineList& rHLL) { aHelpLines=rHLL; -if (bInvalidate) -InvalidateAllWin(); +InvalidateAllWin(); } void SdrPageView::SetHelpLine(sal_uInt16 nNum, const SdrHelpLine& rNewHelpLine) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdpagv.hxx |5 sd/source/ui/func/fusel.cxx |9 --- sd/source/ui/func/futext.cxx |9 --- svx/source/svdraw/svdmrkv.cxx | 51 +++--- 4 files changed, 45 insertions(+), 29 deletions(-) New commits: commit abbe4f9d64073d77c4be93b7c89c03d0651bacef Author: Caolán McNamara Date: Fri Jul 3 15:53:00 2015 +0100 fix deselect of textbox on slides with images in underlying master The original work of tdf#55430 tries to select an object under another one on the second click, but these images are unselectable so this fails. Red Hat has a whole new shiny bunch of templates which have such images in their masters. Check if the object is selectable before continuing Change-Id: I182abaf50e8bb1084c5819dc9e1ffd8b386a9e93 diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx index 5369616..8bf305f 100644 --- a/include/svx/svdpagv.hxx +++ b/include/svx/svdpagv.hxx @@ -235,6 +235,11 @@ public: // Beim Gruppenobjekt muss wenigstens ein Member sichtbar sein, // gesperrt sein darf keiner. bool IsObjMarkable(SdrObject* pObj) const; +// hmm, selectable is surely the same as markable, now that I +// see this as I look for a place to put it. TO-DO, +// merge these +bool IsObjSelectable(SdrObject *pObj) const; + // Betreten (Editieren) einer Objektgruppe. Anschliessend liegen alle // Memberobjekte der Gruppe im direkten Zugriff. Alle anderen Objekte diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index dd63708..000ac60 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -684,9 +684,12 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) **/ if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK)) { -mpView->UnmarkAllObj(); -mpView->MarkObj(pObj,pPV,false,false); -return true; +if (pPV->IsObjSelectable(pObj)) +{ +mpView->UnmarkAllObj(); +mpView->MarkObj(pObj,pPV,false,false); +return true; +} } /** * Toggle between selection and rotation diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index e308e2e..c3b4090 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -657,9 +657,12 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) **/ if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK)) { -mpView->UnmarkAllObj(); -mpView->MarkObj(pObj,pPV,false,false); -return bReturn; +if (pPV->IsObjSelectable(pObj)) +{ +mpView->UnmarkAllObj(); +mpView->MarkObj(pObj,pPV,false,false); +return bReturn; +} } } } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index f58f88b..d281507 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -1226,6 +1226,33 @@ void SdrMarkView::SetRef2(const Point& rPt) } } +bool SdrPageView::IsObjSelectable(SdrObject *pObj) const +{ +SdrLayerID nLay=pObj->GetLayer(); +bool bRaus=!pObj->IsInserted(); // Obj deleted? +if (!pObj->Is3DObj()) { +bRaus=bRaus || pObj->GetPage()!=GetPage(); // Obj suddenly in different Page or Group +} +bRaus=bRaus || GetLockedLayers().IsSet(nLay) || // Layer locked? + !GetVisibleLayers().IsSet(nLay); // Layer invisible? + +if( !bRaus ) +bRaus = !pObj->IsVisible(); // invisible objects can not be selected + +if (!bRaus) { +// Grouped objects can now be selected. +// After EnterGroup the higher-level objects, +// have to be deselected, though. +const SdrObjList* pOOL=pObj->GetObjList(); +const SdrObjList* pVOL=GetObjList(); +while (pOOL!=NULL && pOOL!=pVOL) { +pOOL=pOOL->GetUpList(); +} +bRaus=pOOL!=pVOL; +} +return !bRaus; +} + void SdrMarkView::CheckMarked() { for (size_t nm=GetMarkedObjectCount(); nm>0;) { @@ -1233,29 +1260,7 @@ void SdrMarkView::CheckMarked() SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); SdrPageView* pPV=pM->GetPageView(); -SdrLayerID nLay=pObj->GetLayer(); -bool bRaus=!pObj->IsInsert
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdglev.hxx|4 ++-- include/svx/svdpntv.hxx|2 +- sd/source/ui/view/drviews7.cxx |2 +- svx/source/svdraw/svdglev.cxx |8 4 files changed, 8 insertions(+), 8 deletions(-) New commits: commit ddac8522821ae288d4ce1533f9ebe8daf9e2d935 Author: Miklos Vajna Date: Sun Oct 19 12:02:47 2014 +0200 -Werror=shadow Change-Id: I940661c947307dc5dea371e5e6f9a9aedbfc904d diff --git a/include/svx/svdglev.hxx b/include/svx/svdglev.hxx index a7dd3f3..75bd590 100644 --- a/include/svx/svdglev.hxx +++ b/include/svx/svdglev.hxx @@ -50,13 +50,13 @@ public: // checken bzw. setzen/loeschen will. // Moegliche Werte fuer nThisEsc sind z.Zt. // SDRESC_LEFT, SDRESC_RIGHT, SDRESC_TOP und SDRESC_BOTTOM -TRISTATE IsMarkedGluePointsEscDir(sal_uInt16 nThisEsc) const; +SDR_TRISTATE IsMarkedGluePointsEscDir(sal_uInt16 nThisEsc) const; void SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, bool bOn); bool IsSetMarkedGluePointsEscDirPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); } // Checken/setzen, ob die Klebepunktpositionen relativ zur // Objektgroesse sind (Percent=sal_True) oder nicht (Percent=sal_False) -TRISTATE IsMarkedGluePointsPercent() const; +SDR_TRISTATE IsMarkedGluePointsPercent() const; void SetMarkedGluePointsPercent(bool bOn); bool IsSetMarkedGluePointsPercentPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); } diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index 16bdc9d..54df1af 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -76,7 +76,7 @@ enum SdrAnimationMode // Typedef's und defines -typedef unsigned char TRISTATE; +typedef unsigned char SDR_TRISTATE; #define FUZZY (2) #define SDR_ANYFORMAT (0x) #define SDR_ANYITEM (0x) diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index c47b4a1..6a57586 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -461,7 +461,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) SfxItemState::DEFAULT == rSet.GetItemState( SID_GLUE_VERTALIGN_BOTTOM ) ) { // percent -TRISTATE eState = mpDrawView->IsMarkedGluePointsPercent(); +SDR_TRISTATE eState = mpDrawView->IsMarkedGluePointsPercent(); if( eState == TRISTATE_INDET ) rSet.InvalidateItem( SID_GLUE_PERCENT ); else diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx index af7f705..31a3509 100644 --- a/svx/source/svdraw/svdglev.cxx +++ b/svx/source/svdraw/svdglev.cxx @@ -106,13 +106,13 @@ static void ImpGetEscDir(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const voi } } -TRISTATE SdrGlueEditView::IsMarkedGluePointsEscDir(sal_uInt16 nThisEsc) const +SDR_TRISTATE SdrGlueEditView::IsMarkedGluePointsEscDir(sal_uInt16 nThisEsc) const { ForceUndirtyMrkPnt(); bool bFirst=true; sal_uInt16 nRet=0; ((SdrGlueEditView*)this)->ImpDoMarkedGluePoints(ImpGetEscDir,true,&bFirst,&nThisEsc,&nRet); -return (TRISTATE)nRet; +return (SDR_TRISTATE)nRet; } static void ImpSetEscDir(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pnThisEsc, const void* pbOn, const void*, const void*, const void*) @@ -144,13 +144,13 @@ static void ImpGetPercent(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const vo } } -TRISTATE SdrGlueEditView::IsMarkedGluePointsPercent() const +SDR_TRISTATE SdrGlueEditView::IsMarkedGluePointsPercent() const { ForceUndirtyMrkPnt(); bool bFirst=true; sal_uInt16 nRet=sal_True; ((SdrGlueEditView*)this)->ImpDoMarkedGluePoints(ImpGetPercent,true,&bFirst,&nRet); -return (TRISTATE)nRet; +return (SDR_TRISTATE)nRet; } static void ImpSetPercent(SdrGluePoint& rGP, const SdrObject* pObj, const void* pbOn, const void*, const void*, const void*, const void*) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdobj.hxx |2 - sd/source/ui/dlg/morphdlg.cxx |6 ++--- sd/source/ui/func/fumorph.cxx |4 +-- svx/source/sdr/properties/customshapeproperties.cxx |2 - svx/source/sdr/properties/defaultproperties.cxx |8 +++ svx/source/sdr/properties/emptyproperties.cxx |2 - svx/source/sdr/properties/pageproperties.cxx|2 - svx/source/svdraw/svdoattr.cxx |4 +-- svx/source/svdraw/svdobj.cxx| 22 svx/source/svdraw/svdogrp.cxx |4 +-- 10 files changed, 22 insertions(+), 34 deletions(-) New commits: commit 42172ea6478023d94d4f76f3b525180d2ff25695 Author: Stephan Bergmann Date: Tue Aug 5 23:04:07 2014 +0200 Let GetObjectItemPool return a reference Change-Id: Ibbcfa3452afcf88dbb6050765e081a1be2381334 diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 6dfc816..3eac84f 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -467,7 +467,7 @@ public: virtual void SetModel(SdrModel* pNewModel); SdrModel* GetModel() const { return pModel;} -SfxItemPool* GetObjectItemPool() const; +SfxItemPool & GetObjectItemPool() const; void AddListener(SfxListener& rListener); void RemoveListener(SfxListener& rListener); diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx index f8895e2..301ef79 100644 --- a/sd/source/ui/dlg/morphdlg.cxx +++ b/sd/source/ui/dlg/morphdlg.cxx @@ -44,9 +44,9 @@ MorphDlg::MorphDlg( ::Window* pParent, const SdrObject* pObj1, const SdrObject* LoadSettings(); -SfxItemPool*pPool = (SfxItemPool*) pObj1->GetObjectItemPool(); -SfxItemSet aSet1( *pPool ); -SfxItemSet aSet2( *pPool ); +SfxItemPool & pPool = pObj1->GetObjectItemPool(); +SfxItemSet aSet1( pPool ); +SfxItemSet aSet2( pPool ); aSet1.Put(pObj1->GetMergedItemSet()); aSet2.Put(pObj2->GetMergedItemSet()); diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 5aa763a..272a95d 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -342,8 +342,8 @@ void FuMorph::ImpInsertPolygons( longnStartLineWidth = 0; longnEndLineWidth = 0; SdrPageView*pPageView = mpView->GetSdrPageView(); -SfxItemPool*pPool = pObj1->GetObjectItemPool(); -SfxItemSet aSet1( *pPool,SDRATTR_START,SDRATTR_NOTPERSIST_FIRST-1,EE_ITEMS_START,EE_ITEMS_END,0 ); +SfxItemPool & pPool = pObj1->GetObjectItemPool(); +SfxItemSet aSet1( pPool,SDRATTR_START,SDRATTR_NOTPERSIST_FIRST-1,EE_ITEMS_START,EE_ITEMS_END,0 ); SfxItemSet aSet2( aSet1 ); boolbLineColor = false; boolbFillColor = false; diff --git a/svx/source/sdr/properties/customshapeproperties.cxx b/svx/source/sdr/properties/customshapeproperties.cxx index 97d4921..716dfb5 100644 --- a/svx/source/sdr/properties/customshapeproperties.cxx +++ b/svx/source/sdr/properties/customshapeproperties.cxx @@ -109,7 +109,7 @@ namespace sdr TextProperties::ClearObjectItemDirect( nWhich2 ); nWhich2 = aIter.NextWhich(); } -SfxItemSet aSet((SfxItemPool&)(*GetSdrObject().GetObjectItemPool())); +SfxItemSet aSet(GetSdrObject().GetObjectItemPool()); ItemSetChanged(aSet); } else diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx index 47b32c6..a7d60a4 100644 --- a/svx/source/sdr/properties/defaultproperties.cxx +++ b/svx/source/sdr/properties/defaultproperties.cxx @@ -81,7 +81,7 @@ namespace sdr { if(!mpItemSet) { -((DefaultProperties*)this)->mpItemSet = &(((DefaultProperties*)this)->CreateObjectSpecificItemSet(*GetSdrObject().GetObjectItemPool())); +((DefaultProperties*)this)->mpItemSet = &(((DefaultProperties*)this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool())); ((DefaultProperties*)this)->ForceDefaultAttributes(); } @@ -99,7 +99,7 @@ namespace sdr ItemChange(nWhichID, &rItem); PostItemChange(nWhichID); -SfxItemSet aSet(*GetSdrObject().GetObjectItemPool(), nWhichID, nWhichID); +SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), nWhichID, nWhichID); aSet.Put(rItem); ItemSetChanged(aSet); } @@ -124,7 +124,7 @@ namespace sdr if(nWhich) { -SfxItemSet aSet(*GetSdrObject().GetObjectItemPool(), nWhich, nWhich, 0, 0); +SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), nWhich, nWhich
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdmodel.hxx |6 ++ sd/source/ui/dlg/unchss.cxx |8 sd/source/ui/func/fupage.cxx |2 +- svx/source/sdr/properties/attributeproperties.cxx |2 +- svx/source/svdraw/svdmodel.cxx|5 ++--- 5 files changed, 10 insertions(+), 13 deletions(-) New commits: commit e9f405a0daf1dc47a46cb902f05fe24e095b837d Author: Stephan Bergmann Date: Mon Jun 16 12:00:37 2014 +0200 Clean up SdrModel::MigrateItemSet * No need to support null pNewModel argument (the one call site that did pass in null explicitly in sd/source/ui/func/fupate.cxx can just as well pass in mpDoc, and all existing call sites are guaranteed to pass in a non-null value). * With that changed, SdrModel::MigrateItemSet can be static. (At least in JunitTest_forms_unoapi it could happen that the call from svx/source/sdr/properties/attributeproperites.cxx called MigrateItemSet on a null GetSdrObject.GetModel(), which was undefined behavior even though it was harmless.) Change-Id: Idface48da7e889c6e5768d0e49bc67c88b4c3ec4 diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index ae32250..a97bf5d 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -645,10 +645,8 @@ public: virtual SvxNumType GetPageNumType() const; /** copies the items from the source set to the destination set. Both sets must have -same ranges but can have different pools. If pNewModel is optional. If it is null, -this model is used. */ - -void MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel* pNewModel ); +same ranges but can have different pools. */ +static void MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel* pNewModel ); bool IsInDestruction() const { return mbInDestruction;} diff --git a/sd/source/ui/dlg/unchss.cxx b/sd/source/ui/dlg/unchss.cxx index a876559..05a5f02 100644 --- a/sd/source/ui/dlg/unchss.cxx +++ b/sd/source/ui/dlg/unchss.cxx @@ -46,10 +46,10 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc, // Create ItemSets; Attention, it is possible that the new one is from a, // different pool. Therefore we clone it with its items. pNewSet = new SfxItemSet((SfxItemPool&)SdrObject::GetGlobalDrawObjectItemPool(), pTheNewItemSet->GetRanges()); -pTheDoc->MigrateItemSet( pTheNewItemSet, pNewSet, pTheDoc ); +SdrModel::MigrateItemSet( pTheNewItemSet, pNewSet, pTheDoc ); pOldSet = new SfxItemSet((SfxItemPool&)SdrObject::GetGlobalDrawObjectItemPool(),pStyleSheet->GetItemSet().GetRanges()); -pTheDoc->MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet, pTheDoc ); +SdrModel::MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet, pTheDoc ); aComment = SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT); OUString aName(pStyleSheet->GetName()); @@ -98,7 +98,7 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc, void StyleSheetUndoAction::Undo() { SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() ); -mpDoc->MigrateItemSet( pOldSet, &aNewSet, mpDoc ); +SdrModel::MigrateItemSet( pOldSet, &aNewSet, mpDoc ); pStyleSheet->GetItemSet().Set(aNewSet); if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) @@ -111,7 +111,7 @@ void StyleSheetUndoAction::Undo() void StyleSheetUndoAction::Redo() { SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() ); -mpDoc->MigrateItemSet( pNewSet, &aNewSet, mpDoc ); +SdrModel::MigrateItemSet( pNewSet, &aNewSet, mpDoc ); pStyleSheet->GetItemSet().Set(aNewSet); if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 9277632..a0bb59f 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -301,7 +301,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) // MigrateItemSet makes sure the XFillBitmapItem will have a unique name SfxItemSet aMigrateSet( mpDoc->GetPool(), XATTR_FILLBITMAP, XATTR_FILLBITMAP ); aMigrateSet.Put(XFillBitmapItem(OUString("background"), aGraphic)); -mpDoc->MigrateItemSet( &aMigrateSet, pTempSet.get(), NULL ); +SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc ); pTempSet->Put( XFillBmpStretchItem( true )); pTempSet->Put( XFillBmpTileItem( false )); diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index 2675438..d7665c8 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -268,7 +268,7 @@ namespace sdr } mpItemSet = mpItemSet->Cl
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/ChildrenManager.hxx |7 - sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx | 57 +++--- sd/source/ui/inc/AccessibleDrawDocumentView.hxx |2 svx/source/accessibility/ChildrenManager.cxx |4 svx/source/accessibility/ChildrenManagerImpl.cxx |9 +- svx/source/accessibility/ChildrenManagerImpl.hxx |8 - 6 files changed, 31 insertions(+), 56 deletions(-) New commits: commit 6014e3c98d7f1f767297ff0f0b6f1a3be18b32d0 Author: Stephan Bergmann Date: Thu Nov 28 15:19:55 2013 +0100 Use rtl::Reference instead of std::auto_ptr Change-Id: I4402b0b259c0dcd03a222993c861114028d6fb75 diff --git a/include/svx/ChildrenManager.hxx b/include/svx/ChildrenManager.hxx index c2e6df8..2049ab7 100644 --- a/include/svx/ChildrenManager.hxx +++ b/include/svx/ChildrenManager.hxx @@ -24,13 +24,11 @@ #include #include #include -#include #include namespace accessibility { class AccessibleContextBase; -class AccessibleShape; class ChildrenManagerImpl; /** The AccessibleChildrenManager class acts as a cache of the @@ -154,10 +152,9 @@ public: be created by the shape factory. This gives the caller full control over object creation. -@param pShape -This class does take ownership of the argument. +@param shape must be non-null */ -void AddAccessibleShape (std::auto_ptr pShape); +void AddAccessibleShape (css::uno::Reference const & shape); /** Clear the list of accessible shapes which have been added by previous calls to AddAccessibleShape. diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx index 5dd336d..2c4558a 100644 --- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx +++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx @@ -122,20 +122,11 @@ void AccessibleDrawDocumentView::Init (void) mpChildrenManager = new ChildrenManager(this, xShapeList, maShapeTreeInfo, *this); if (mpChildrenManager != NULL) { -// Create the page shape and initialize it. The shape is acquired -// before initialization and released after transferring ownership -// to the children manager to prevent premature disposing of the -// shape. -AccessiblePageShape* pPage = CreateDrawPageShape(); -if (pPage != NULL) +rtl::Reference xPage(CreateDrawPageShape()); +if (xPage.is()) { -pPage->acquire(); -pPage->Init(); -SAL_WNODEPRECATED_DECLARATIONS_PUSH -mpChildrenManager->AddAccessibleShape ( -std::auto_ptr(pPage)); -SAL_WNODEPRECATED_DECLARATIONS_POP -pPage->release(); +xPage->Init(); +mpChildrenManager->AddAccessibleShape (xPage.get()); mpChildrenManager->Update (); } mpChildrenManager->UpdateSelection (); @@ -159,9 +150,9 @@ void AccessibleDrawDocumentView::ViewForwarderChanged (ChangeType aChangeType, /** The page shape is created on every call at the moment (provided that every thing goes well). */ -AccessiblePageShape* AccessibleDrawDocumentView::CreateDrawPageShape (void) +rtl::Reference AccessibleDrawDocumentView::CreateDrawPageShape (void) { -AccessiblePageShape* pShape = NULL; +rtl::Reference xShape; // Create a shape that represents the actual draw page. uno::Reference xView (mxController, uno::UNO_QUERY); @@ -201,12 +192,12 @@ AccessiblePageShape* AccessibleDrawDocumentView::CreateDrawPageShape (void) // Create the accessible object for the shape and // initialize it. -pShape = new AccessiblePageShape ( +xShape = new AccessiblePageShape ( xView->getCurrentPage(), this, maShapeTreeInfo); } } } -return pShape; +return xShape; } @@ -351,21 +342,12 @@ void SAL_CALL mpChildrenManager->SetShapeList (uno::Reference ( xView->getCurrentPage(), uno::UNO_QUERY)); -// Create the page shape and initialize it. The shape is -// acquired before initialization and released after -// transferring ownership to the children manager to prevent -// premature disposing of the shape. -AccessiblePageShape* pPage = CreateDrawPageShape (); -if (pPage != NULL) +rtl::Reference xPage(CreateDrawPageShape ()); +if (xPage.is()) { -pPage->acquire(); -pPage->Init(); -SAL_WNODEPRECATED_DECLARATIONS_PUSH -mpChildrenManager->AddAccessibleShape ( -std::auto_ptr(pPage)); -SAL_WNODEPRECATED_DECLARATIONS_POP +xPage->Init(); +