summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-02-01 15:54:13 +0100
committerMichael Stahl <mstahl@redhat.com>2013-02-03 02:14:14 +0100
commit20740feba8a7d62058a9c4c4bfddb6e19476b5e7 (patch)
tree3d4cdd32dce37209507bde954eb82471df46da13
parent5c8c9738e025064aa52b77635c170c5b7212965f (diff)
sw: tweak SwXRedlinePortion a bit
Change-Id: I2191a55d729b136050467d8a78893482170e29e0
-rw-r--r--sw/inc/unoport.hxx12
-rw-r--r--sw/source/core/unocore/unoportenum.cxx2
-rw-r--r--sw/source/core/unocore/unoredline.cxx19
3 files changed, 17 insertions, 16 deletions
diff --git a/sw/inc/unoport.hxx b/sw/inc/unoport.hxx
index a4604fca54c8..27230e52c228 100644
--- a/sw/inc/unoport.hxx
+++ b/sw/inc/unoport.hxx
@@ -308,21 +308,21 @@ protected:
class SwXRedlinePortion : public SwXTextPortion
{
private:
- SwRedline const* pRedline;
+ SwRedline const& m_rRedline;
void Validate() throw (::com::sun::star::uno::RuntimeException);
using SwXTextPortion::GetPropertyValue;
+ virtual ~SwXRedlinePortion();
+
public:
SwXRedlinePortion(
- SwRedline const* pRedline,
+ SwRedline const& rRedline,
SwUnoCrsr const* pPortionCrsr,
::com::sun::star::uno::Reference< ::com::sun::star::text::XText >
- xParent,
- sal_Bool const bIsStart);
-
- virtual ~SwXRedlinePortion();
+ const& xParent,
+ bool const bIsStart);
static ::com::sun::star::uno::Any GetPropertyValue(
OUString const& PropertyName, SwRedline const& rRedline) throw();
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index b1eff9dc2258..43c1eb1deb35 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -980,7 +980,7 @@ lcl_ExportRedline(
else if ( nIndex == nRealIndex )
{
rPortions.push_back( new SwXRedlinePortion(
- pPtr->m_pRedline, pUnoCrsr, xParent, pPtr->m_bStart) );
+ *pPtr->m_pRedline, pUnoCrsr, xParent, pPtr->m_bStart));
rRedlineArr.erase ( aIter++ );
}
// MTG: 23/11/05: If we've iterated past nIndex, exit the loop
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index e6e6c406c57f..ce0e056a024e 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -183,13 +183,14 @@ sal_Bool SwXRedlineText::hasElements( ) throw(uno::RuntimeException)
return sal_True; // we always have a content index
}
-SwXRedlinePortion::SwXRedlinePortion( const SwRedline* pRed,
- const SwUnoCrsr* pPortionCrsr,
- uno::Reference< text::XText > xParent, sal_Bool bStart) :
- SwXTextPortion(pPortionCrsr, xParent, bStart ? PORTION_REDLINE_START : PORTION_REDLINE_END),
- pRedline(pRed)
+SwXRedlinePortion::SwXRedlinePortion(SwRedline const& rRedline,
+ SwUnoCrsr const*const pPortionCrsr,
+ uno::Reference< text::XText > const& xParent, bool const bStart)
+ : SwXTextPortion(pPortionCrsr, xParent,
+ (bStart) ? PORTION_REDLINE_START : PORTION_REDLINE_END)
+ , m_rRedline(rRedline)
{
- SetCollapsed(!pRedline->HasMark());
+ SetCollapsed(!m_rRedline.HasMark());
}
SwXRedlinePortion::~SwXRedlinePortion()
@@ -253,7 +254,7 @@ uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName )
uno::Any aRet;
if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_TEXT)))
{
- SwNodeIndex* pNodeIdx = pRedline->GetContentIdx();
+ SwNodeIndex* pNodeIdx = m_rRedline.GetContentIdx();
if(pNodeIdx )
{
if ( 1 < ( pNodeIdx->GetNode().EndOfSectionIndex() - pNodeIdx->GetNode().GetIndex() ) )
@@ -269,7 +270,7 @@ uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName )
}
else
{
- aRet = GetPropertyValue( rPropertyName, *pRedline);
+ aRet = GetPropertyValue(rPropertyName, m_rRedline);
if(!aRet.hasValue() &&
! rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_SUCCESSOR_DATA)))
aRet = SwXTextPortion::getPropertyValue(rPropertyName);
@@ -287,7 +288,7 @@ void SwXRedlinePortion::Validate() throw( uno::RuntimeException )
const SwRedlineTbl& rRedTbl = pDoc->GetRedlineTbl();
bool bFound = false;
for(sal_uInt16 nRed = 0; nRed < rRedTbl.size() && !bFound; nRed++)
- bFound = pRedline == rRedTbl[nRed];
+ bFound = &m_rRedline == rRedTbl[nRed];
if(!bFound)
throw uno::RuntimeException();
}