summaryrefslogtreecommitdiff
path: root/filter/inc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-07-28 00:35:14 +0200
committerMichael Stahl <mstahl@redhat.com>2012-07-28 00:48:22 +0200
commitce66ded6fe2a291301c8e075be67347211d4309d (patch)
tree573477a0d310ea844bc066bc041a9ddbf8ae3fe0 /filter/inc
parent8a05f1265e6307c34b2ffdb5fc5279870c8397b7 (diff)
fix STL conversion 3ae618f9e4c34d5f6f10d953e3fb074018001748:
It turns out that this SvxMSDffShapeInfos has some, shall we say, non-obvious properties, including a split personality that changes its nature from checking for pointer equality to not doing so; symptoms of this include a failing sw_subsequent_ww8export test. Try to cure this madness by splitting the personalities into distinct types, a set and a multiset. Change-Id: Ib87368564b8e1f61379703034c0965422c6dcd0e
Diffstat (limited to 'filter/inc')
-rw-r--r--filter/inc/filter/msfilter/msdffimp.hxx78
1 files changed, 41 insertions, 37 deletions
diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx
index 6b20aaa7aa28..f69f076a28f3 100644
--- a/filter/inc/filter/msfilter/msdffimp.hxx
+++ b/filter/inc/filter/msfilter/msdffimp.hxx
@@ -26,26 +26,36 @@
*
************************************************************************/
-#ifndef _MSDFFIMP_HXX
-#define _MSDFFIMP_HXX
+#ifndef FLT_MSDFFIMP_HXX
+#define FLT_MSDFFIMP_HXX
+
+#include <string.h>
+
+#include <map>
+#include <vector>
+#include <set>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/ptr_container/ptr_set.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
#include <tools/solar.h>
#include <tools/color.hxx>
#include <tools/gen.hxx>
-#include <svx/msdffdef.hxx>
+
+#include <sot/storage.hxx>
+
#include <vcl/graph.hxx>
-#include <string.h>
-#include <map>
-#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <svx/msdffdef.hxx>
+
#include <filter/msfilter/msfilterdllapi.h>
-#include <sot/storage.hxx>
-#include <vector>
-#include <set>
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/ptr_container/ptr_set.hpp>
-#include <o3tl/sorted_vector.hxx>
+
class Graphic;
class SvStream;
@@ -189,18 +199,23 @@ public:
~SvxMSDffShapeOrders();
};
-// the following will be sorted explicitly:
-class SvxMSDffShapeInfos
- : public o3tl::sorted_vector<SvxMSDffShapeInfo*,
- o3tl::less_ptr_to<SvxMSDffShapeInfo> >
+struct MSFILTER_DLLPUBLIC CompareSvxMSDffShapeInfoById
{
-public:
- ~SvxMSDffShapeInfos()
- {
- DeleteAndDestroyAll();
- }
+ bool operator()(::boost::shared_ptr<SvxMSDffShapeInfo> const& lhs,
+ ::boost::shared_ptr<SvxMSDffShapeInfo> const& rhs) const;
+};
+struct MSFILTER_DLLPUBLIC CompareSvxMSDffShapeInfoByTxBxComp
+{
+ bool operator()(::boost::shared_ptr<SvxMSDffShapeInfo> const& lhs,
+ ::boost::shared_ptr<SvxMSDffShapeInfo> const& rhs) const;
};
+// the following will be sorted explicitly:
+typedef ::std::set< ::boost::shared_ptr<SvxMSDffShapeInfo>,
+ CompareSvxMSDffShapeInfoById > SvxMSDffShapeInfos_ById;
+typedef ::std::multiset< ::boost::shared_ptr<SvxMSDffShapeInfo>,
+ CompareSvxMSDffShapeInfoByTxBxComp> SvxMSDffShapeInfos_ByTxBxComp;
+
#define SVXMSDFF_SETTINGS_CROP_BITMAPS 1
#define SVXMSDFF_SETTINGS_IMPORT_PPT 2
#define SVXMSDFF_SETTINGS_IMPORT_EXCEL 4
@@ -463,7 +478,8 @@ class MSFILTER_DLLPUBLIC SvxMSDffManager : public DffPropertyReader
{
FmFormModel* pFormModel;
SvxMSDffBLIPInfos* pBLIPInfos;
- SvxMSDffShapeInfos* pShapeInfos;
+ ::boost::scoped_ptr<SvxMSDffShapeInfos_ByTxBxComp> m_pShapeInfosByTxBxComp;
+ ::boost::scoped_ptr<SvxMSDffShapeInfos_ById> m_pShapeInfosById;
SvxMSDffShapeOrders* pShapeOrders;
sal_uLong nDefaultFontHeight;
sal_uInt32 nOffsDgg;
@@ -751,8 +767,8 @@ public:
const Rectangle& rClientRect,
const Rectangle& rGlobalChildRect );
- inline const SvxMSDffShapeInfos* GetShapeInfos( void ) const
- { return pShapeInfos; }
+ inline const SvxMSDffShapeInfos_ById* GetShapeInfos( void ) const
+ { return m_pShapeInfosById.get(); }
inline const SvxMSDffShapeOrders* GetShapeOrders( void ) const
{ return pShapeOrders; }
@@ -820,7 +836,6 @@ struct SvxMSDffShapeInfo
sal_uInt32 nTxBxComp;
sal_Bool bReplaceByFly :1; ///< shape can be replaced by a frame in Writer
- sal_Bool bSortByShapeId :1;
sal_Bool bLastBoxInChain:1;
explicit SvxMSDffShapeInfo(sal_uLong nFPos, sal_uInt32 nId=0, // sal_uLong nBIdx=0,
@@ -830,7 +845,6 @@ struct SvxMSDffShapeInfo
nTxBxComp( (nSeqId << 16) + nBoxId )
{
bReplaceByFly = sal_False;
- bSortByShapeId = sal_False;
bLastBoxInChain = sal_True;
}
SvxMSDffShapeInfo(SvxMSDffShapeInfo& rInfo):
@@ -839,21 +853,11 @@ struct SvxMSDffShapeInfo
nTxBxComp( rInfo.nTxBxComp )
{
bReplaceByFly = rInfo.bReplaceByFly;
- bSortByShapeId = rInfo.bSortByShapeId;
bLastBoxInChain = rInfo.bLastBoxInChain;
}
- sal_Bool operator==( const SvxMSDffShapeInfo& rEntry ) const
- {
- return bSortByShapeId ? (nShapeId == rEntry.nShapeId)
- : (nTxBxComp == rEntry.nTxBxComp && this == &rEntry);
- }
- sal_Bool operator<( const SvxMSDffShapeInfo& rEntry ) const
- {
- return bSortByShapeId ? (nShapeId < rEntry.nShapeId)
- : (nTxBxComp < rEntry.nTxBxComp);
- }
};
+
struct SvxMSDffShapeOrder
{
sal_uLong nShapeId; ///< shape id used in PLCF SPA and in mso_fbtSp (FSP)