summaryrefslogtreecommitdiff
path: root/sw/source/filter/html/wrthtml.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-07-13 14:56:23 +0200
committerMichael Stahl <mstahl@redhat.com>2012-07-17 15:33:32 +0200
commit22461ae3712fa77a18be99fe76d6f0531058e388 (patch)
treecd6435a69f2d5d049f1a777629c475df2efcc19c /sw/source/filter/html/wrthtml.hxx
parent637b9d4f825b9a96b042effa55f462bae9a0491d (diff)
Convert SV_DECL_PTRARR_SORT_DEL(HTMLControls) to o3tl::sorted_vector
I had to move the HTMLControl struct to the header file to avoid warnings about delete not being called. Change-Id: I822afba210d34f5855ae052fb34e117a16578970
Diffstat (limited to 'sw/source/filter/html/wrthtml.hxx')
-rw-r--r--sw/source/filter/html/wrthtml.hxx33
1 files changed, 30 insertions, 3 deletions
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index 2b328e4d48ed..a4f14c79de95 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -35,9 +35,9 @@
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/form/XForm.hpp>
#include <vcl/field.hxx>
-#include <svl/svstdarr.hxx>
#include <i18npool/lang.h>
#include <tools/stream.hxx>
+#include <o3tl/sorted_vector.hxx>
#include "shellio.hxx"
#include "wrt_fn.hxx"
@@ -191,8 +191,35 @@ const sal_uInt32 HTML_FRMOPTS_GENIMG =
#define CSS1_OUTMODE_SCRIPT ((sal_uInt16)(0x0007U << 11))
// der HTML-Writer
-struct HTMLControl;
-SV_DECL_PTRARR_SORT_DEL( HTMLControls, HTMLControl*, 1 )
+struct HTMLControl
+{
+ // die Form, zu der das Control gehoert
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > xFormComps;
+ sal_uLong nNdIdx; // der Node, in dem es verankert ist
+ xub_StrLen nCount; // wie viele Controls sind in dem Node
+
+ HTMLControl( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > & rForm,
+ sal_uInt32 nIdx );
+ ~HTMLControl();
+
+ // operatoren fuer das Sort-Array
+ bool operator==( const HTMLControl& rCtrl ) const
+ {
+ return nNdIdx == rCtrl.nNdIdx;
+ }
+ bool operator<( const HTMLControl& rCtrl ) const
+ {
+ return nNdIdx < rCtrl.nNdIdx;
+ }
+};
+
+class HTMLControls : public o3tl::sorted_vector<HTMLControl*, o3tl::less_ptr_to<HTMLControl> > {
+public:
+ // will free any items still in the vector
+ ~HTMLControls() { DeleteAndDestroyAll(); }
+};
+
+
typedef std::vector<SwFmtINetFmt*> INetFmts;
struct SwHTMLFmtInfo