[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - 2 commits - include/svx sc/source svx/source
Julien Nabet
serval2412 at yahoo.fr
Tue Jun 9 03:34:32 PDT 2015
include/svx/svdundo.hxx | 3 -
sc/source/ui/miscdlgs/scuiautofmt.cxx | 2 -
svx/source/svdraw/svdundo.cxx | 66 ----------------------------------
3 files changed, 1 insertion(+), 70 deletions(-)
New commits:
commit 78468b1cd267e3020173b11007922a509d2941ba
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sun May 31 15:17:19 2015 +0200
tdf#91726: AutoFormat: Crash when using an existing name
Add a test to check if name already exists
Change-Id: Ie23de04c0b747f58ab61a6e498bf212bf38b346a
Reviewed-on: https://gerrit.libreoffice.org/16000
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 3807946b5515e943169da907866c93b52a2b3f19)
Reviewed-on: https://gerrit.libreoffice.org/16056
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index b55b722..0829363 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -211,7 +211,7 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl)
{
aFormatName = pDlg->GetInputString();
- if ( !aFormatName.isEmpty() && !aFormatName.equals(aStrStandard) )
+ if ( !aFormatName.isEmpty() && !aFormatName.equals(aStrStandard) && pFormat->find(aFormatName) == pFormat->end() )
{
ScAutoFormatData* pNewData
= new ScAutoFormatData( *pSelFmtData );
commit 8fd1fc17fab7ec639e5a9de79db5122113da9ef9
Author: David Tardon <dtardon at redhat.com>
Date: Wed Jan 28 09:18:51 2015 +0100
tdf#78854 do not crash when undoing layout change
It turns out that the ordinal number adjustment that was added for
fdo#34548 is no longer necessary.
Change-Id: I2c491a008500b6a269b6f05a2a72f5aa70edecb2
(cherry picked from commit c0117fcb3dbd6c2a8d5e7679ee8d6fb29264ff6b)
Reviewed-on: https://gerrit.libreoffice.org/16152
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
index c3e4861..f72c676 100644
--- a/include/svx/svdundo.hxx
+++ b/include/svx/svdundo.hxx
@@ -242,9 +242,6 @@ protected:
SdrView* pView; // To be able to re-create the selection for a
SdrPageView* pPageView; // for a ObjDel, Undo
sal_uInt32 nOrdNum;
- // It's possible that the object is re-assigned during a Undo/Redo.
- // The object is deleted in the dtor, if bOwner==TRUE
- ObjListListener* m_pListener;
protected:
SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect = false);
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index bde9c51..b901845 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -679,73 +679,11 @@ OUString SdrUndoGeoObj::GetComment() const
-class SdrUndoObjList::ObjListListener : public SfxListener
-{
-public:
- ObjListListener(SdrUndoObjList& rThat, SdrObject& rObject, SfxBroadcaster& rBroadcaster);
- virtual ~ObjListListener();
-
-private:
- virtual void Notify(SfxBroadcaster& rBroadcaster, const SfxHint& rHint) SAL_OVERRIDE;
-
-private:
- SdrUndoObjList& m_rThat;
- SdrObject& m_rObject;
- SfxBroadcaster* m_pBroadcaster;
-};
-
-SdrUndoObjList::ObjListListener::ObjListListener(SdrUndoObjList& rThat, SdrObject& rObject, SfxBroadcaster& rBroadcaster)
- : m_rThat(rThat)
- , m_rObject(rObject)
- , m_pBroadcaster(&rBroadcaster)
-{
- StartListening(*m_pBroadcaster);
-}
-
-SdrUndoObjList::ObjListListener::~ObjListListener()
-{
- if (m_pBroadcaster)
- EndListening(*m_pBroadcaster);
-}
-
-void SdrUndoObjList::ObjListListener::Notify(SfxBroadcaster&, const SfxHint& rHint)
-{
- const SdrHint* const pSdrHint(dynamic_cast<const SdrHint*>(&rHint));
- if (pSdrHint)
- {
- if (pSdrHint->GetObject() == &m_rObject)
- {
- switch (pSdrHint->GetKind())
- {
- case HINT_OBJCHG :
- if (IsListening(*m_pBroadcaster))
- {
- const sal_uInt32 nNewOrdNum(m_rObject.GetOrdNum());
- if (nNewOrdNum != m_rThat.GetOrdNum())
- m_rThat.SetOrdNum(nNewOrdNum);
- }
- break;
- case HINT_OBJREMOVED :
- SAL_WARN_IF(!IsListening(*m_pBroadcaster), "svx.sdr", "Object is not in any list");
- EndListening(*m_pBroadcaster);
- break;
- case HINT_OBJINSERTED :
- SAL_WARN_IF(IsListening(*m_pBroadcaster), "svx.sdr", "Object is already in a list");
- StartListening(*m_pBroadcaster);
- break;
- default :
- break;
- }
- }
- }
-}
-
SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect)
: SdrUndoObj(rNewObj)
, bOwner(false)
, pView(NULL)
, pPageView(NULL)
- , m_pListener(NULL)
{
pObjList=pObj->GetObjList();
if (bOrdNumDirect)
@@ -756,16 +694,12 @@ SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect)
{
nOrdNum=pObj->GetOrdNum();
}
-
- m_pListener = new ObjListListener(*this, *pObj, *pObj->GetModel());
}
SdrUndoObjList::~SdrUndoObjList()
{
SolarMutexGuard aGuard;
- delete m_pListener;
-
if (pObj!=NULL && IsOwner())
{
// Attribute have to go back to the regular Pool
More information about the Libreoffice-commits
mailing list