[Libreoffice-commits] .: 2 commits - starmath/inc starmath/source sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Jan 18 03:33:44 PST 2011
starmath/inc/edit.hxx | 2 -
starmath/source/edit.cxx | 14 ++++-----
sw/source/core/layout/ssfrm.cxx | 57 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 65 insertions(+), 8 deletions(-)
New commits:
commit 2dbe9e73bfce57f7841c34d285f913ff13f7a3ea
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 18 11:33:38 2011 +0000
restore SwFrm::~SwFrm
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index a979866..827b82a 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -364,6 +364,63 @@ Point SwFrm::GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const
|*************************************************************************/
+SwFrm::~SwFrm()
+{
+ // accessible objects for fly and cell frames have been already disposed
+ // by the destructors of the derived classes.
+ if( IsAccessibleFrm() && !(IsFlyFrm() || IsCellFrm()) && GetDep() )
+ {
+ SwRootFrm *pRootFrm = FindRootFrm();
+ if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
+ {
+ ViewShell *pVSh = pRootFrm->GetCurrShell();
+ if( pVSh && pVSh->Imp() )
+ {
+ OSL_ENSURE( !GetLower(), "Lowers should be dispose already!" );
+ pVSh->Imp()->DisposeAccessibleFrm( this );
+ }
+ }
+ }
+
+ if( pDrawObjs )
+ {
+ for ( sal_uInt32 i = pDrawObjs->Count(); i; )
+ {
+ SwAnchoredObject* pAnchoredObj = (*pDrawObjs)[--i];
+ if ( pAnchoredObj->ISA(SwFlyFrm) )
+ delete pAnchoredObj;
+ else
+ {
+ SdrObject* pSdrObj = pAnchoredObj->DrawObj();
+ SwDrawContact* pContact =
+ static_cast<SwDrawContact*>(pSdrObj->GetUserCall());
+ OSL_ENSURE( pContact,
+ "<SwFrm::~SwFrm> - missing contact for drawing object" );
+ if ( pContact )
+ {
+ pContact->DisconnectObjFromLayout( pSdrObj );
+ }
+ }
+ }
+ if ( pDrawObjs )
+ delete pDrawObjs;
+ }
+
+#if OSL_DEBUG_LEVEL > 1
+ // JP 15.10.2001: for detection of access to deleted frames
+ pDrawObjs = (SwSortedObjs*)0x33333333;
+#endif
+}
+
+/*************************************************************************
+|*
+|* SwLayoutFrm::SetFrmFmt()
+|* Ersterstellung MA 22. Apr. 93
+|* Letzte Aenderung MA 02. Nov. 94
+|*
+|*************************************************************************/
+
+
void SwLayoutFrm::SetFrmFmt( SwFrmFmt *pNew )
{
if ( pNew != GetFmt() )
commit 7ac39f8d93dff3dd7c4940a558e225c75aed1d93
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 18 11:05:04 2011 +0000
we can pass this by reference instead
diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx
index 9563d66..ff99a82 100644
--- a/starmath/inc/edit.hxx
+++ b/starmath/inc/edit.hxx
@@ -49,7 +49,7 @@ class CommandEvent;
/**************************************************************************/
- void SmGetLeftSelectionPart(const ESelection aSelection,
+ void SmGetLeftSelectionPart(const ESelection &rSelection,
USHORT &nPara, USHORT &nPos);
/**************************************************************************/
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index b618fcc..44a1a49 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -81,19 +81,19 @@ using namespace com::sun::star::uno;
////////////////////////////////////////
-void SmGetLeftSelectionPart(const ESelection aSel,
+void SmGetLeftSelectionPart(const ESelection &rSel,
USHORT &nPara, USHORT &nPos)
// returns paragraph number and position of the selections left part
{
// compare start and end of selection and use the one that comes first
- if ( aSel.nStartPara < aSel.nEndPara
- || (aSel.nStartPara == aSel.nEndPara && aSel.nStartPos < aSel.nEndPos) )
- { nPara = aSel.nStartPara;
- nPos = aSel.nStartPos;
+ if ( rSel.nStartPara < rSel.nEndPara
+ || (rSel.nStartPara == rSel.nEndPara && rSel.nStartPos < rSel.nEndPos) )
+ { nPara = rSel.nStartPara;
+ nPos = rSel.nStartPos;
}
else
- { nPara = aSel.nEndPara;
- nPos = aSel.nEndPos;
+ { nPara = rSel.nEndPara;
+ nPos = rSel.nEndPos;
}
}
More information about the Libreoffice-commits
mailing list