svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx | 3 + svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx | 9 +++ svx/source/sdr/contact/viewobjectcontactofgroup.cxx | 9 +++ svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx | 7 ++- svx/source/svdraw/svdibrow.cxx | 42 +++++++++--------- svx/source/svdraw/svdobj.cxx | 6 -- xmloff/source/style/impastp4.cxx | 2 7 files changed, 52 insertions(+), 26 deletions(-)
New commits: commit 09d4525b11f396a68ca7c5cbb1ae3462db40c77c Author: David Tardon <dtar...@redhat.com> Date: Sun Mar 24 14:08:14 2013 +0100 fdo#62617 display groups on multiple layers correctly It is possible to group objects from different layers, so it is an error to rely on layer ID when checking visibility of a group. This problem was partially obscured by the fact that SdrObjGroup::GetLayer() returns 0 if its subobjects are on different layers and 0 is a valid layer ID. Change-Id: I0ef75544a26817154642185864cafd4e6734fa38 diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx index b925889..fda5610 100644 --- a/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx @@ -40,6 +40,9 @@ namespace sdr // This method recursively paints the draw hierarchy. virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const; + + private: + virtual bool isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const; }; } // end of namespace contact } // end of namespace sdr diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx index d7609bd..e038442 100644 --- a/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofsdrobj.hxx @@ -25,6 +25,7 @@ ////////////////////////////////////////////////////////////////////////////// // predeclarations class SdrObject; +class SetOfByte; ////////////////////////////////////////////////////////////////////////////// @@ -34,6 +35,14 @@ namespace sdr { class SVX_DLLPUBLIC ViewObjectContactOfSdrObj : public ViewObjectContact { + /** Test whether the primitive is visible on any layer from @c aLayers + + This should be overriden by ViewObjectContacts of SDR classes + that have subparts which can be on different layers (that is, + SdrObjGroup .-) + */ + virtual bool isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const; + protected: const SdrObject& getSdrObject() const; diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx index cdd21db..724b77e 100644 --- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx @@ -25,6 +25,7 @@ #include <drawinglayer/primitive2d/groupprimitive2d.hxx> #include <basegfx/tools/canvastools.hxx> #include <svx/sdr/contact/viewcontact.hxx> +#include <svx/svdobj.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -98,6 +99,14 @@ namespace sdr } return xRetval; } + + bool ViewObjectContactOfGroup::isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const + { + SetOfByte aObjectLayers; + getSdrObject().getMergedHierarchyLayerSet(aObjectLayers); + aObjectLayers &= aLayers; + return !aObjectLayers.IsEmpty(); + } } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx index e184bde..77c97cd 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx @@ -48,12 +48,17 @@ namespace sdr { } + bool ViewObjectContactOfSdrObj::isPrimitiveVisibleOnAnyLayer(const SetOfByte& aLayers) const + { + return aLayers.IsSet(getSdrObject().GetLayer()); + } + bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const { const SdrObject& rObject = getSdrObject(); // Test layer visibility - if(!rDisplayInfo.GetProcessLayers().IsSet(rObject.GetLayer())) + if(!isPrimitiveVisibleOnAnyLayer(rDisplayInfo.GetProcessLayers())) { return false; } commit 9a100bc4f96a8a909b3a2b81cd09079612a9e909 Author: David Tardon <dtar...@redhat.com> Date: Sun Mar 24 14:27:15 2013 +0100 avoid possible data inconsistency GetLayer() is virtual, so it might not be always the same as mnLayerID. Change-Id: Idabf02505678a7150a94498be3bc4ffc20ac56af diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 6f6da7bb..40e6c0c 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -650,10 +650,7 @@ void SdrObject::getMergedHierarchyLayerSet(SetOfByte& rSet) const void SdrObject::NbcSetLayer(SdrLayerID nLayer) { - if(GetLayer() != nLayer) - { - mnLayerID = nLayer; - } + mnLayerID = nLayer; } void SdrObject::SetLayer(SdrLayerID nLayer) commit 85dc7b010ac8e6d6ab0ac214ea6651cbe7598cf1 Author: David Tardon <dtar...@redhat.com> Date: Sat Mar 23 13:49:17 2013 +0100 drop nonsensical warning Change-Id: I3f63268535bf8ed13a4728ed3eb3528193712e6e diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index d12d56b..6f6da7bb 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2932,7 +2932,6 @@ void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUn { if ( !xOldUnoShape.is() ) { - SAL_WARN_IF( mpSvxShape, "svx.sdr", "SdrObject::impl_setUnoShape: still having impl. pointer to dead object!" ); // make sure there is no stale impl. pointer if the UNO // shape was destroyed meanwhile (remember we only hold weak // reference to it!) commit 9b9a70ec0a332f26a841575e8bb7bec44b6faa78 Author: David Tardon <dtar...@redhat.com> Date: Sat Mar 23 12:29:07 2013 +0100 print typename of object, not pointer Change-Id: I6d364851173b53c541b80e0d7e77d431f218ce15 diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index 6f6f15c..2867858 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -89,7 +89,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily( "Adding duplicate family " << rStrName << " with mismatching mapper ! " << typeid(*aFind->mxMapper.get()).name() << " " << - typeid(rMapper.get()).name() ); + typeid(*rMapper.get()).name() ); } #endif commit d2e3b282947432ae49043074644cf6aa63cb5757 Author: David Tardon <dtar...@redhat.com> Date: Sat Mar 23 11:29:34 2013 +0100 fix crash after conversion to STL Change-Id: I0a49ce4ddf53eede0f940b392aab20afb5dd2cbe diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 5ee5d0b..cb77ec4 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -562,27 +562,31 @@ void _SdrItemBrowserControl::BrkChangeEntry() void _SdrItemBrowserControl::ImpSetEntry(const ImpItemListRow& rEntry, sal_uIntPtr nEntryNum) { - ImpItemListRow* pAktEntry=ImpGetEntry(nEntryNum); - if (pAktEntry==NULL) { + SAL_WARN_IF(nEntryNum > aList.size(), "svx", "trying to set item " << nEntryNum << "in a vector of size " << aList.size()); + if (nEntryNum >= aList.size()) { + nEntryNum = aList.size(); aList.push_back(new ImpItemListRow(rEntry)); RowInserted(nEntryNum); - } else if (*pAktEntry!=rEntry) { - bool bStateDiff=rEntry.eState!=pAktEntry->eState; - bool bValueDiff=!rEntry.aValue.equals(pAktEntry->aValue); - bool bAllDiff = true; - if (bStateDiff || bValueDiff) { - // check whether only state and/or value have changed - ImpItemListRow aTest(rEntry); - aTest.eState=pAktEntry->eState; - aTest.aValue=pAktEntry->aValue; - if (aTest==*pAktEntry) bAllDiff = false; - } - *pAktEntry=rEntry; - if (bAllDiff) { - RowModified(nEntryNum); - } else { - if (bStateDiff) RowModified(nEntryNum,ITEMBROWSER_STATECOL_ID); - if (bValueDiff) RowModified(nEntryNum,ITEMBROWSER_VALUECOL_ID); + } else { + ImpItemListRow* pAktEntry=ImpGetEntry(nEntryNum); + if (*pAktEntry!=rEntry) { + bool bStateDiff=rEntry.eState!=pAktEntry->eState; + bool bValueDiff=!rEntry.aValue.equals(pAktEntry->aValue); + bool bAllDiff = true; + if (bStateDiff || bValueDiff) { + // check whether only state and/or value have changed + ImpItemListRow aTest(rEntry); + aTest.eState=pAktEntry->eState; + aTest.aValue=pAktEntry->aValue; + if (aTest==*pAktEntry) bAllDiff = false; + } + *pAktEntry=rEntry; + if (bAllDiff) { + RowModified(nEntryNum); + } else { + if (bStateDiff) RowModified(nEntryNum,ITEMBROWSER_STATECOL_ID); + if (bValueDiff) RowModified(nEntryNum,ITEMBROWSER_VALUECOL_ID); + } } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits