Kaydet (Commit) e1323281 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

use UnoCursorPointer in ParagraphFrameEnumeration

Change-Id: I5fdf0bdd8609aa07c49b155cc75cade8bdb2c292
üst 4186d572
...@@ -22,42 +22,49 @@ ...@@ -22,42 +22,49 @@
#include <deque> #include <deque>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/text/XTextContent.hpp> #include <com/sun/star/text/XTextContent.hpp>
#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase.hxx>
#include <calbck.hxx>
#include <unobaseclass.hxx> #include <unobaseclass.hxx>
class SwDepend; class SwDepend;
class SwNodeIndex; class SwNodeIndex;
class SwPaM; class SwPaM;
class SwFrameFormat; class SwFrameFormat;
struct FrameDependSortListEntry namespace sw
{
struct FrameClient : public SwClient
{
FrameClient(SwModify* pModify) : SwClient(pModify) {};
};
}
struct FrameClientSortListEntry
{ {
sal_Int32 nIndex; sal_Int32 nIndex;
sal_uInt32 nOrder; sal_uInt32 nOrder;
::boost::shared_ptr<SwDepend> pFrameDepend; std::shared_ptr<sw::FrameClient> pFrameClient;
FrameDependSortListEntry (sal_Int32 const i_nIndex, FrameClientSortListEntry (sal_Int32 const i_nIndex,
sal_uInt32 const i_nOrder, SwDepend * const i_pDepend) sal_uInt32 const i_nOrder, sw::FrameClient* const i_pClient)
: nIndex(i_nIndex), nOrder(i_nOrder), pFrameDepend(i_pDepend) { } : nIndex(i_nIndex), nOrder(i_nOrder), pFrameClient(i_pClient) { }
}; };
typedef ::std::deque< FrameDependSortListEntry > typedef ::std::deque< FrameClientSortListEntry >
FrameDependSortList_t; FrameClientSortList_t;
typedef ::std::deque< ::boost::shared_ptr<SwDepend> > typedef ::std::deque< std::shared_ptr<sw::FrameClient> >
FrameDependList_t; FrameClientList_t;
// #i28701# - adjust 4th parameter // #i28701# - adjust 4th parameter
void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, void CollectFrameAtNode( const SwNodeIndex& rIdx,
FrameDependSortList_t & rFrames, FrameClientSortList_t& rFrames,
const bool _bAtCharAnchoredObjs ); const bool bAtCharAnchoredObjs );
enum ParaFrameMode enum ParaFrameMode
{ {
......
...@@ -80,7 +80,7 @@ static void lcl_CreatePortions( ...@@ -80,7 +80,7 @@ static void lcl_CreatePortions(
TextRangeList_t & i_rPortions, TextRangeList_t & i_rPortions,
uno::Reference< text::XText > const& i_xParentText, uno::Reference< text::XText > const& i_xParentText,
SwUnoCrsr* pUnoCrsr, SwUnoCrsr* pUnoCrsr,
FrameDependSortList_t & i_rFrames, FrameClientSortList_t & i_rFrames,
const sal_Int32 i_nStartPos, const sal_Int32 i_nEndPos ); const sal_Int32 i_nStartPos, const sal_Int32 i_nEndPos );
namespace namespace
...@@ -371,8 +371,8 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration( ...@@ -371,8 +371,8 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration(
"start or end value invalid!"); "start or end value invalid!");
// find all frames, graphics and OLEs that are bound AT character in para // find all frames, graphics and OLEs that are bound AT character in para
FrameDependSortList_t frames; FrameClientSortList_t frames;
::CollectFrameAtNode(*this, m_pUnoCrsr->GetPoint()->nNode, frames, true); ::CollectFrameAtNode(m_pUnoCrsr->GetPoint()->nNode, frames, true);
lcl_CreatePortions(m_Portions, xParentText, m_pUnoCrsr.get(), frames, nStart, nEnd); lcl_CreatePortions(m_Portions, xParentText, m_pUnoCrsr.get(), frames, nStart, nEnd);
} }
...@@ -1187,7 +1187,7 @@ static sal_Int32 lcl_ExportFrames( ...@@ -1187,7 +1187,7 @@ static sal_Int32 lcl_ExportFrames(
TextRangeList_t & rPortions, TextRangeList_t & rPortions,
Reference<XText> const & i_xParent, Reference<XText> const & i_xParent,
SwUnoCrsr * const i_pUnoCrsr, SwUnoCrsr * const i_pUnoCrsr,
FrameDependSortList_t & i_rFrames, FrameClientSortList_t & i_rFrames,
sal_Int32 const i_nCurrentIndex) sal_Int32 const i_nCurrentIndex)
{ {
// Ignore frames which are not exported, as we are exporting a selection // Ignore frames which are not exported, as we are exporting a selection
...@@ -1200,7 +1200,7 @@ static sal_Int32 lcl_ExportFrames( ...@@ -1200,7 +1200,7 @@ static sal_Int32 lcl_ExportFrames(
// do not check for i_nEnd here; this is done implicity by lcl_MoveCursor // do not check for i_nEnd here; this is done implicity by lcl_MoveCursor
{ {
const SwModify * const pFrame = const SwModify * const pFrame =
i_rFrames.front().pFrameDepend->GetRegisteredIn(); i_rFrames.front().pFrameClient->GetRegisteredIn();
if (pFrame) // Frame could be disposed if (pFrame) // Frame could be disposed
{ {
SwXTextPortion* pPortion = new SwXTextPortion(i_pUnoCrsr, i_xParent, SwXTextPortion* pPortion = new SwXTextPortion(i_pUnoCrsr, i_xParent,
...@@ -1243,7 +1243,7 @@ static void lcl_CreatePortions( ...@@ -1243,7 +1243,7 @@ static void lcl_CreatePortions(
TextRangeList_t & i_rPortions, TextRangeList_t & i_rPortions,
uno::Reference< text::XText > const & i_xParentText, uno::Reference< text::XText > const & i_xParentText,
SwUnoCrsr * const pUnoCrsr, SwUnoCrsr * const pUnoCrsr,
FrameDependSortList_t & i_rFrames, FrameClientSortList_t & i_rFrames,
const sal_Int32 i_nStartPos, const sal_Int32 i_nStartPos,
const sal_Int32 i_nEndPos ) const sal_Int32 i_nEndPos )
{ {
......
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