Kaydet (Commit) c5390b3e authored tarafından Michael Stahl's avatar Michael Stahl

SwXDocumentIndexMark::CreateXDocumentIndexMark does not need SwTOXType

... passed in as parameter since it's always the one from pMark.

Change-Id: Ia5981b0f281c8cac70cbb305c82bb6785918168a
üst 57b29dc9
...@@ -222,7 +222,7 @@ public: ...@@ -222,7 +222,7 @@ public:
static ::com::sun::star::uno::Reference< static ::com::sun::star::uno::Reference<
::com::sun::star::text::XDocumentIndexMark> ::com::sun::star::text::XDocumentIndexMark>
CreateXDocumentIndexMark(SwDoc & rDoc, CreateXDocumentIndexMark(SwDoc & rDoc,
SwTOXType * pType, SwTOXMark * pMark, TOXTypes eType = TOX_INDEX); SwTOXMark * pMark, TOXTypes eType = TOX_INDEX);
static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
......
...@@ -627,7 +627,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 ...@@ -627,7 +627,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
eType = TOX_CONTENT; eType = TOX_CONTENT;
else if(SW_SERVICE_USER_INDEX_MARK == nObjectType) else if(SW_SERVICE_USER_INDEX_MARK == nObjectType)
eType = TOX_USER; eType = TOX_USER;
xRet = SwXDocumentIndexMark::CreateXDocumentIndexMark(*pDoc, 0, 0, eType); xRet = SwXDocumentIndexMark::CreateXDocumentIndexMark(*pDoc, 0, eType);
} }
break; break;
case SW_SERVICE_CONTENT_INDEX : case SW_SERVICE_CONTENT_INDEX :
......
...@@ -481,8 +481,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry ...@@ -481,8 +481,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
static_cast<SwTOXMark &>((*marks.begin())->GetAttr()); static_cast<SwTOXMark &>((*marks.begin())->GetAttr());
const uno::Reference< text::XDocumentIndexMark > xRef = const uno::Reference< text::XDocumentIndexMark > xRef =
SwXDocumentIndexMark::CreateXDocumentIndexMark( SwXDocumentIndexMark::CreateXDocumentIndexMark(
*rPam.GetDoc(), *rPam.GetDoc(), &rMark);
const_cast<SwTOXType*>(rMark.GetTOXType()), &rMark);
(*pAny) <<= xRef; (*pAny) <<= xRef;
} }
} }
......
...@@ -1197,8 +1197,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, ...@@ -1197,8 +1197,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
{ {
SwTOXMark* pMark = aMarks[i]; SwTOXMark* pMark = aMarks[i];
pxMarks[i] = SwXDocumentIndexMark::CreateXDocumentIndexMark( pxMarks[i] = SwXDocumentIndexMark::CreateXDocumentIndexMark(
*m_pImpl->m_pDoc, *m_pImpl->m_pDoc, pMark);
const_cast<SwTOXType*>(pType), pMark);
} }
aRet <<= aXMarks; aRet <<= aXMarks;
} }
...@@ -1674,10 +1673,8 @@ SwXDocumentIndexMark::~SwXDocumentIndexMark() ...@@ -1674,10 +1673,8 @@ SwXDocumentIndexMark::~SwXDocumentIndexMark()
uno::Reference<text::XDocumentIndexMark> uno::Reference<text::XDocumentIndexMark>
SwXDocumentIndexMark::CreateXDocumentIndexMark( SwXDocumentIndexMark::CreateXDocumentIndexMark(
SwDoc & rDoc, SwTOXType *const pType, SwTOXMark *const pMark, SwDoc & rDoc, SwTOXMark *const pMark, TOXTypes const eType)
TOXTypes const eType)
{ {
assert((pType != 0) == (pMark != 0));
// re-use existing SwXDocumentIndexMark // re-use existing SwXDocumentIndexMark
// NB: xmloff depends on this caching to generate ID from the address! // NB: xmloff depends on this caching to generate ID from the address!
// #i105557#: do not iterate over the registered clients: race condition // #i105557#: do not iterate over the registered clients: race condition
...@@ -1689,7 +1686,8 @@ SwXDocumentIndexMark::CreateXDocumentIndexMark( ...@@ -1689,7 +1686,8 @@ SwXDocumentIndexMark::CreateXDocumentIndexMark(
if (!xTOXMark.is()) if (!xTOXMark.is())
{ {
SwXDocumentIndexMark *const pNew((pMark) SwXDocumentIndexMark *const pNew((pMark)
? new SwXDocumentIndexMark(rDoc, *pType, *pMark) ? new SwXDocumentIndexMark(rDoc,
*const_cast<SwTOXType*>(pMark->GetTOXType()), *pMark)
: new SwXDocumentIndexMark(eType)); : new SwXDocumentIndexMark(eType));
xTOXMark.set(pNew); xTOXMark.set(pNew);
if (pMark) if (pMark)
......
...@@ -537,8 +537,7 @@ lcl_CreateTOXMarkPortion( ...@@ -537,8 +537,7 @@ lcl_CreateTOXMarkPortion(
SwTOXMark & rTOXMark = static_cast<SwTOXMark&>(rAttr.GetAttr()); SwTOXMark & rTOXMark = static_cast<SwTOXMark&>(rAttr.GetAttr());
const Reference<XTextContent> xContent( const Reference<XTextContent> xContent(
SwXDocumentIndexMark::CreateXDocumentIndexMark(*pDoc, SwXDocumentIndexMark::CreateXDocumentIndexMark(*pDoc, & rTOXMark),
const_cast<SwTOXType*>(rTOXMark.GetTOXType()), & rTOXMark),
uno::UNO_QUERY); uno::UNO_QUERY);
SwXTextPortion* pPortion = 0; SwXTextPortion* pPortion = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment