summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/poly.h13
-rw-r--r--tools/inc/tools/date.hxx3
-rw-r--r--tools/inc/tools/fldunit.hxx44
-rw-r--r--tools/inc/tools/fontenum.hxx175
-rw-r--r--tools/inc/tools/fsys.hxx2
-rw-r--r--tools/inc/tools/gen.hxx31
-rw-r--r--tools/inc/tools/inetdef.hxx2
-rw-r--r--tools/inc/tools/mapunit.hxx44
-rw-r--r--tools/inc/tools/poly.hxx2
-rw-r--r--tools/inc/tools/solar.h4
-rwxr-xr-xtools/inc/tools/solarmutex.hxx45
-rw-r--r--tools/inc/tools/wintypes.hxx337
-rw-r--r--tools/prj/d.lst6
-rw-r--r--tools/qa/makefile.mk4
-rw-r--r--tools/qa/test_pathutils.cxx2
-rw-r--r--tools/source/datetime/tdate.cxx6
-rw-r--r--tools/source/fsys/unx.cxx2
-rw-r--r--tools/source/fsys/wntmsc.cxx2
-rw-r--r--tools/source/generic/line.cxx5
-rw-r--r--tools/source/generic/poly.cxx64
-rw-r--r--tools/source/generic/poly2.cxx17
-rw-r--r--tools/source/memtools/table.cxx41
-rw-r--r--tools/source/misc/makefile.mk3
-rw-r--r--tools/source/misc/solarmutex.cxx60
-rw-r--r--tools/source/stream/strmunx.cxx2
-rw-r--r--tools/test/makefile.mk9
-rw-r--r--tools/test/tests.cxx2
27 files changed, 800 insertions, 127 deletions
diff --git a/tools/inc/poly.h b/tools/inc/poly.h
index ed70359be0c0..4f281a9b1359 100644
--- a/tools/inc/poly.h
+++ b/tools/inc/poly.h
@@ -99,17 +99,4 @@ public:
~ImplPolyPolygon();
};
-inline long MinMax( long nVal, long nMin, long nMax )
-{
- return( nVal >= nMin ? ( nVal <= nMax ? nVal : nMax ) : nMin );
-}
-
-// ------------------------------------------------------------------
-
-inline long FRound( double fVal )
-{
- return( fVal > 0.0 ? (long) ( fVal + 0.5 ) : -(long) ( -fVal + 0.5 ) );
-}
-
-
#endif // _SV_POLY_H
diff --git a/tools/inc/tools/date.hxx b/tools/inc/tools/date.hxx
index 87602e27d874..e14be54b7df1 100644
--- a/tools/inc/tools/date.hxx
+++ b/tools/inc/tools/date.hxx
@@ -115,6 +115,9 @@ public:
TOOLS_DLLPUBLIC friend Date operator +( const Date& rDate, long nDays );
TOOLS_DLLPUBLIC friend Date operator -( const Date& rDate, long nDays );
TOOLS_DLLPUBLIC friend long operator -( const Date& rDate1, const Date& rDate2 );
+
+ static long DateToDays( USHORT nDay, USHORT nMonth, USHORT nYear );
+
};
#endif // _DATE_HXX
diff --git a/tools/inc/tools/fldunit.hxx b/tools/inc/tools/fldunit.hxx
new file mode 100644
index 000000000000..786796030eb3
--- /dev/null
+++ b/tools/inc/tools/fldunit.hxx
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fldunit.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _TOOLS_FLDUNIT_HXX
+#define _TOOLS_FLDUNIT_HXX
+
+// --------------
+// - FieldTypes -
+// --------------
+
+// By changes you must also change: rsc/vclrsc.hxx
+enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
+ FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
+ FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM,
+ FUNIT_PERCENT, FUNIT_100TH_MM };
+
+#endif // _TOOLS_FLDUNIT_HXX
diff --git a/tools/inc/tools/fontenum.hxx b/tools/inc/tools/fontenum.hxx
new file mode 100644
index 000000000000..6c529cedb30d
--- /dev/null
+++ b/tools/inc/tools/fontenum.hxx
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: vclenum.hxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _TOOLS_FONTENUM_HXX
+#define _TOOLS_FONTENUM_HXX
+
+#include <sal/types.h>
+#include <tools/solar.h>
+
+#ifndef ENUM_FONTFAMILY_DECLARED
+#define ENUM_FONTFAMILY_DECLARED
+
+enum FontFamily { FAMILY_DONTKNOW, FAMILY_DECORATIVE, FAMILY_MODERN,
+ FAMILY_ROMAN, FAMILY_SCRIPT, FAMILY_SWISS, FAMILY_SYSTEM, FontFamily_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+#endif
+
+// ------------------------------------------------------------
+
+#ifndef ENUM_FONTPITCH_DECLARED
+#define ENUM_FONTPITCH_DECLARED
+
+enum FontPitch { PITCH_DONTKNOW, PITCH_FIXED, PITCH_VARIABLE, FontPitch_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+#endif
+
+// ------------------------------------------------------------
+
+#ifndef ENUM_TEXTALIGN_DECLARED
+#define ENUM_TEXTALIGN_DECLARED
+
+enum TextAlign { ALIGN_TOP, ALIGN_BASELINE, ALIGN_BOTTOM, TextAlign_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+#endif
+
+// ------------------------------------------------------------
+
+#ifndef ENUM_FONTWEIGHT_DECLARED
+#define ENUM_FONTWEIGHT_DECLARED
+
+enum FontWeight { WEIGHT_DONTKNOW, WEIGHT_THIN, WEIGHT_ULTRALIGHT,
+ WEIGHT_LIGHT, WEIGHT_SEMILIGHT, WEIGHT_NORMAL,
+ WEIGHT_MEDIUM, WEIGHT_SEMIBOLD, WEIGHT_BOLD,
+ WEIGHT_ULTRABOLD, WEIGHT_BLACK, FontWeight_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+#endif
+
+// ------------------------------------------------------------
+
+#ifndef ENUM_FONTWIDTH_DECLARED
+#define ENUM_FONTWIDTH_DECLARED
+
+enum FontWidth { WIDTH_DONTKNOW, WIDTH_ULTRA_CONDENSED, WIDTH_EXTRA_CONDENSED,
+ WIDTH_CONDENSED, WIDTH_SEMI_CONDENSED, WIDTH_NORMAL,
+ WIDTH_SEMI_EXPANDED, WIDTH_EXPANDED, WIDTH_EXTRA_EXPANDED,
+ WIDTH_ULTRA_EXPANDED,
+ FontWidth_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+#endif
+
+// ------------------------------------------------------------
+
+#ifndef ENUM_FONTITALIC_DECLARED
+#define ENUM_FONTITALIC_DECLARED
+
+enum FontItalic { ITALIC_NONE, ITALIC_OBLIQUE, ITALIC_NORMAL, ITALIC_DONTKNOW, FontItalic_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+#endif
+
+// ------------------------------------------------------------
+
+#ifndef ENUM_FONTUNDERLINE_DECLARED
+#define ENUM_FONTUNDERLINE_DECLARED
+
+enum FontUnderline { UNDERLINE_NONE, UNDERLINE_SINGLE, UNDERLINE_DOUBLE,
+ UNDERLINE_DOTTED, UNDERLINE_DONTKNOW,
+ UNDERLINE_DASH, UNDERLINE_LONGDASH,
+ UNDERLINE_DASHDOT, UNDERLINE_DASHDOTDOT,
+ UNDERLINE_SMALLWAVE,
+ UNDERLINE_WAVE, UNDERLINE_DOUBLEWAVE,
+ UNDERLINE_BOLD, UNDERLINE_BOLDDOTTED,
+ UNDERLINE_BOLDDASH, UNDERLINE_BOLDLONGDASH,
+ UNDERLINE_BOLDDASHDOT, UNDERLINE_BOLDDASHDOTDOT,
+ UNDERLINE_BOLDWAVE,
+ FontUnderline_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+#endif
+
+// ------------------------------------------------------------
+
+#ifndef ENUM_FONTSTRIKEOUT_DECLARED
+#define ENUM_FONTSTRIKEOUT_DECLARED
+
+enum FontStrikeout { STRIKEOUT_NONE, STRIKEOUT_SINGLE, STRIKEOUT_DOUBLE,
+ STRIKEOUT_DONTKNOW, STRIKEOUT_BOLD,
+ STRIKEOUT_SLASH, STRIKEOUT_X,
+ FontStrikeout_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+#endif
+
+// ------------------------------------------------------------
+
+#ifndef ENUM_FONTEMPHASISMARK_DECLARED
+#define ENUM_FONTEMPHASISMARK_DECLARED
+
+typedef USHORT FontEmphasisMark;
+#define EMPHASISMARK_NONE ((FontEmphasisMark)0x0000)
+#define EMPHASISMARK_DOT ((FontEmphasisMark)0x0001)
+#define EMPHASISMARK_CIRCLE ((FontEmphasisMark)0x0002)
+#define EMPHASISMARK_DISC ((FontEmphasisMark)0x0003)
+#define EMPHASISMARK_ACCENT ((FontEmphasisMark)0x0004)
+#define EMPHASISMARK_STYLE ((FontEmphasisMark)0x00FF)
+#define EMPHASISMARK_POS_ABOVE ((FontEmphasisMark)0x1000)
+#define EMPHASISMARK_POS_BELOW ((FontEmphasisMark)0x2000)
+
+// Only for kompability
+#define EMPHASISMARK_DOTS_ABOVE (EMPHASISMARK_DOT | EMPHASISMARK_POS_ABOVE)
+#define EMPHASISMARK_DOTS_BELOW (EMPHASISMARK_DOT | EMPHASISMARK_POS_BELOW)
+#define EMPHASISMARK_SIDE_DOTS (EMPHASISMARK_ACCENT | EMPHASISMARK_POS_ABOVE)
+#define EMPHASISMARK_CIRCLE_ABOVE (EMPHASISMARK_CIRCLE | EMPHASISMARK_POS_ABOVE)
+
+#endif
+
+// ------------------------------------------------------------
+
+#ifndef ENUM_FONTTYPE_DECLARED
+#define ENUM_FONTTYPE_DECLARED
+
+enum FontType { TYPE_DONTKNOW, TYPE_RASTER, TYPE_VECTOR, TYPE_SCALABLE,
+ FontType_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+
+#endif
+
+#ifndef ENUM_FONTEMBEDDEDBITMAP_DECLARED
+#define ENUM_FONTEMBEDDEDBITMAP_DECLARED
+
+enum FontEmbeddedBitmap { EMBEDDEDBITMAP_DONTKNOW, EMBEDDEDBITMAP_FALSE, EMBEDDEDBITMAP_TRUE };
+
+#endif
+
+#ifndef ENUM_FONTANTIALIAS_DECLARED
+#define ENUM_FONTANTIALIAS_DECLARED
+
+enum FontAntiAlias { ANTIALIAS_DONTKNOW, ANTIALIAS_FALSE, ANTIALIAS_TRUE };
+
+#endif
+
+#endif // _TOOLS_FONTENUM_HXX
diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index 8223d77106e3..f1da7579aee6 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -570,7 +570,7 @@ void FSysEnableSysErrorBox( BOOL bEnable );
//========================================================================
-#if defined(DBG_UTIL) && !defined(PRODUCT)
+#if defined(DBG_UTIL)
void FSysTest();
#endif
diff --git a/tools/inc/tools/gen.hxx b/tools/inc/tools/gen.hxx
index e01eb98842c2..0d82f4d73160 100644
--- a/tools/inc/tools/gen.hxx
+++ b/tools/inc/tools/gen.hxx
@@ -37,6 +37,37 @@
class SvStream;
+// --------------------
+// - Helper functions -
+// --------------------
+
+inline long MinMax( long nVal, long nMin, long nMax );
+inline long AlignedWidth4Bytes( long nWidthBits );
+inline long FRound( double fVal );
+
+// ---------------
+// - Inlines -
+// ---------------
+
+inline long MinMax( long nVal, long nMin, long nMax )
+{
+ return( nVal >= nMin ? ( nVal <= nMax ? nVal : nMax ) : nMin );
+}
+
+// ------------------------------------------------------------------
+
+inline long AlignedWidth4Bytes( long nWidthBits )
+{
+ return( ( ( nWidthBits + 31 ) >> 5 ) << 2 );
+}
+
+// ------------------------------------------------------------------
+
+inline long FRound( double fVal )
+{
+ return( fVal > 0.0 ? (long) ( fVal + 0.5 ) : -(long) ( -fVal + 0.5 ) );
+}
+
// --------
// - Pair -
// --------
diff --git a/tools/inc/tools/inetdef.hxx b/tools/inc/tools/inetdef.hxx
index 38cd8935e06b..d9861f64961d 100644
--- a/tools/inc/tools/inetdef.hxx
+++ b/tools/inc/tools/inetdef.hxx
@@ -61,8 +61,6 @@
#define TOOLS_INETDEF_OS "FreeBSD/amd64"
#elif defined SINIX
#define TOOLS_INETDEF_OS "SINIX"
-#elif defined IRIX
-#define TOOLS_INETDEF_OS "IRIX"
#else // AIX, HPUX, SOLARIS, ...
#define TOOLS_INETDEF_OS "Unix"
#endif // AIX, HPUX, SOLARIS, ...
diff --git a/tools/inc/tools/mapunit.hxx b/tools/inc/tools/mapunit.hxx
new file mode 100644
index 000000000000..76267192347a
--- /dev/null
+++ b/tools/inc/tools/mapunit.hxx
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: mapunit.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _TOOLS_MAPUNIT_HXX
+#define _TOOLS_MAPUNIT_HXX
+
+// -----------------
+// - MapMode-Types -
+// -----------------
+
+// By changes you must also change: rsc/vclrsc.hxx
+enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
+ MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
+ MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT,
+ MAP_RELATIVE, MAP_REALAPPFONT, MAP_LASTENUMDUMMY };
+
+#endif // _TOOLS_MAPUNIT_HXX
diff --git a/tools/inc/tools/poly.hxx b/tools/inc/tools/poly.hxx
index a77782bc963c..05092957c48e 100644
--- a/tools/inc/tools/poly.hxx
+++ b/tools/inc/tools/poly.hxx
@@ -182,7 +182,6 @@ public:
void Clip( const Rectangle& rRect, BOOL bPolygon = TRUE );
void Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData = NULL );
- void GetSimple( Polygon& rResult ) const;
/** Adaptive subdivision of polygons with curves
This method adaptively subdivides bezier arcs within the
@@ -288,7 +287,6 @@ public:
void Clip( const Rectangle& rRect );
void Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData = NULL );
- void GetSimple( PolyPolygon& rResult ) const;
/** Adaptive subdivision of polygons with curves
This method adaptively subdivides bezier arcs within the
diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h
index 46fe42b9c36f..195a6fd3ce87 100644
--- a/tools/inc/tools/solar.h
+++ b/tools/inc/tools/solar.h
@@ -385,14 +385,14 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); }
#define __DLLEXTENSION "la.so"
#elif defined LINUX && defined M68K
#define __DLLEXTENSION "lm.so"
+#elif defined LINUX && defined HPPA
+ #define __DLLEXTENSION "lh.so"
#elif defined LINUX
#error unknown plattform
#elif defined FREEBSD && defined X86
#define __DLLEXTENSION "fi.so"
#elif defined FREEBSD && defined X86_64
#define __DLLEXTENSION "fx.so"
-#elif defined IRIX
- #define __DLLEXTENSION "im.so"
#elif defined MACOSX && defined POWERPC
#define __DLLEXTENSION "mxp.dylib"
#elif defined MACOSX && defined X86
diff --git a/tools/inc/tools/solarmutex.hxx b/tools/inc/tools/solarmutex.hxx
new file mode 100755
index 000000000000..42aff1f23f43
--- /dev/null
+++ b/tools/inc/tools/solarmutex.hxx
@@ -0,0 +1,45 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _TOOLS_SOLARMUTEX_HXX
+#define _TOOLS_SOLARMUTEX_HXX
+
+#include "tools/toolsdllapi.h"
+#include <vos/mutex.hxx>
+
+namespace tools
+{
+ class TOOLS_DLLPUBLIC SolarMutex
+ {
+ public:
+ static ::vos::IMutex* GetSolarMutex();
+ static void SetSolarMutex( ::vos::IMutex* pMutex );
+ static bool Acquire();
+ static void Release();
+ };
+}
+
+#endif
diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx
new file mode 100644
index 000000000000..a9c23de87ddd
--- /dev/null
+++ b/tools/inc/tools/wintypes.hxx
@@ -0,0 +1,337 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: wintypes.hxx,v $
+ * $Revision: 1.9 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _TOOLS_WINTYPES_HXX
+#define _TOOLS_WINTYPES_HXX
+
+#include <tools/solar.h>
+#include <sal/types.h>
+
+// ----------------
+// - Window-Types -
+// ----------------
+
+typedef USHORT WindowType;
+#define WINDOW_BASE 0x0100
+#define WINDOW_FIRST (WINDOW_BASE + 0x30)
+#define WINDOW_MESSBOX (WINDOW_FIRST)
+#define WINDOW_INFOBOX (WINDOW_FIRST + 0x01)
+#define WINDOW_WARNINGBOX (WINDOW_FIRST + 0x02)
+#define WINDOW_ERRORBOX (WINDOW_FIRST + 0x03)
+#define WINDOW_QUERYBOX (WINDOW_FIRST + 0x04)
+#define WINDOW_WINDOW (WINDOW_FIRST + 0x05)
+#define WINDOW_SYSWINDOW (WINDOW_FIRST + 0x06)
+#define WINDOW_WORKWINDOW (WINDOW_FIRST + 0x07)
+// #define WINDOW_MDIWINDOW (WINDOW_FIRST + 0x08)
+#define WINDOW_FLOATINGWINDOW (WINDOW_FIRST + 0x09)
+#define WINDOW_DIALOG (WINDOW_FIRST + 0x0a)
+#define WINDOW_MODELESSDIALOG (WINDOW_FIRST + 0x0b)
+#define WINDOW_MODALDIALOG (WINDOW_FIRST + 0x0c)
+#define WINDOW_SYSTEMDIALOG (WINDOW_FIRST + 0x0d)
+#define WINDOW_PATHDIALOG (WINDOW_FIRST + 0x0e)
+#define WINDOW_FILEDIALOG (WINDOW_FIRST + 0x0f)
+#define WINDOW_PRINTERSETUPDIALOG (WINDOW_FIRST + 0x10)
+#define WINDOW_PRINTDIALOG (WINDOW_FIRST + 0x11)
+#define WINDOW_COLORDIALOG (WINDOW_FIRST + 0x12)
+#define WINDOW_FONTDIALOG (WINDOW_FIRST + 0x13)
+#define WINDOW_CONTROL (WINDOW_FIRST + 0x14)
+#define WINDOW_BUTTON (WINDOW_FIRST + 0x15)
+#define WINDOW_PUSHBUTTON (WINDOW_FIRST + 0x16)
+#define WINDOW_OKBUTTON (WINDOW_FIRST + 0x17)
+#define WINDOW_CANCELBUTTON (WINDOW_FIRST + 0x18)
+#define WINDOW_HELPBUTTON (WINDOW_FIRST + 0x19)
+#define WINDOW_IMAGEBUTTON (WINDOW_FIRST + 0x1a)
+#define WINDOW_MENUBUTTON (WINDOW_FIRST + 0x1b)
+#define WINDOW_MOREBUTTON (WINDOW_FIRST + 0x1c)
+#define WINDOW_SPINBUTTON (WINDOW_FIRST + 0x1d)
+#define WINDOW_RADIOBUTTON (WINDOW_FIRST + 0x1e)
+#define WINDOW_IMAGERADIOBUTTON (WINDOW_FIRST + 0x1f)
+#define WINDOW_CHECKBOX (WINDOW_FIRST + 0x20)
+#define WINDOW_TRISTATEBOX (WINDOW_FIRST + 0x21)
+#define WINDOW_EDIT (WINDOW_FIRST + 0x22)
+#define WINDOW_MULTILINEEDIT (WINDOW_FIRST + 0x23)
+#define WINDOW_COMBOBOX (WINDOW_FIRST + 0x24)
+#define WINDOW_LISTBOX (WINDOW_FIRST + 0x25)
+#define WINDOW_MULTILISTBOX (WINDOW_FIRST + 0x26)
+#define WINDOW_FIXEDTEXT (WINDOW_FIRST + 0x27)
+#define WINDOW_FIXEDLINE (WINDOW_FIRST + 0x28)
+#define WINDOW_FIXEDBITMAP (WINDOW_FIRST + 0x29)
+#define WINDOW_FIXEDIMAGE (WINDOW_FIRST + 0x2a)
+#define WINDOW_GROUPBOX (WINDOW_FIRST + 0x2c)
+#define WINDOW_SCROLLBAR (WINDOW_FIRST + 0x2d)
+#define WINDOW_SCROLLBARBOX (WINDOW_FIRST + 0x2e)
+#define WINDOW_SPLITTER (WINDOW_FIRST + 0x2f)
+#define WINDOW_SPLITWINDOW (WINDOW_FIRST + 0x30)
+#define WINDOW_SPINFIELD (WINDOW_FIRST + 0x31)
+#define WINDOW_PATTERNFIELD (WINDOW_FIRST + 0x32)
+#define WINDOW_NUMERICFIELD (WINDOW_FIRST + 0x33)
+#define WINDOW_METRICFIELD (WINDOW_FIRST + 0x34)
+#define WINDOW_CURRENCYFIELD (WINDOW_FIRST + 0x35)
+#define WINDOW_DATEFIELD (WINDOW_FIRST + 0x36)
+#define WINDOW_TIMEFIELD (WINDOW_FIRST + 0x37)
+#define WINDOW_PATTERNBOX (WINDOW_FIRST + 0x38)
+#define WINDOW_NUMERICBOX (WINDOW_FIRST + 0x39)
+#define WINDOW_METRICBOX (WINDOW_FIRST + 0x3a)
+#define WINDOW_CURRENCYBOX (WINDOW_FIRST + 0x3b)
+#define WINDOW_DATEBOX (WINDOW_FIRST + 0x3c)
+#define WINDOW_TIMEBOX (WINDOW_FIRST + 0x3d)
+#define WINDOW_LONGCURRENCYFIELD (WINDOW_FIRST + 0x3e)
+#define WINDOW_LONGCURRENCYBOX (WINDOW_FIRST + 0x3f)
+#define WINDOW_TOOLBOX (WINDOW_FIRST + 0x41)
+#define WINDOW_DOCKINGWINDOW (WINDOW_FIRST + 0x42)
+#define WINDOW_STATUSBAR (WINDOW_FIRST + 0x43)
+#define WINDOW_TABPAGE (WINDOW_FIRST + 0x44)
+#define WINDOW_TABCONTROL (WINDOW_FIRST + 0x45)
+#define WINDOW_TABDIALOG (WINDOW_FIRST + 0x46)
+#define WINDOW_BORDERWINDOW (WINDOW_FIRST + 0x47)
+#define WINDOW_BUTTONDIALOG (WINDOW_FIRST + 0x48)
+#define WINDOW_SYSTEMCHILDWINDOW (WINDOW_FIRST + 0x49)
+#define WINDOW_FIXEDBORDER (WINDOW_FIRST + 0x4a)
+#define WINDOW_SLIDER (WINDOW_FIRST + 0x4b)
+#define WINDOW_MENUBARWINDOW (WINDOW_FIRST + 0x4c)
+#define WINDOW_TREELISTBOX (WINDOW_FIRST + 0x4d)
+#define WINDOW_HELPTEXTWINDOW (WINDOW_FIRST + 0x4e)
+#define WINDOW_INTROWINDOW (WINDOW_FIRST + 0x4f)
+#define WINDOW_LISTBOXWINDOW (WINDOW_FIRST + 0x50)
+#define WINDOW_DOCKINGAREA (WINDOW_FIRST + 0x51)
+#define WINDOW_LAST (WINDOW_DOCKINGAREA)
+
+
+// ---------------
+// - Window-Bits -
+// ---------------
+
+// By changes you must also change: rsc/vclrsc.hxx
+typedef sal_Int64 WinBits;
+
+// Window-Bits fuer Window
+#define WB_CLIPCHILDREN ((WinBits)0x00000001)
+#define WB_DIALOGCONTROL ((WinBits)0x00000002)
+#define WB_NODIALOGCONTROL ((WinBits)0x00000004)
+#define WB_BORDER ((WinBits)0x00000008)
+#define WB_NOBORDER ((WinBits)0x00000010)
+#define WB_SIZEABLE ((WinBits)0x00000020)
+#define WB_3DLOOK ((WinBits)0x00000040)
+#define WB_AUTOSIZE ((WinBits)0x00000080)
+
+// Window-Bits fuer SystemWindows
+#define WB_MOVEABLE ((WinBits)0x00000100)
+#define WB_ROLLABLE ((WinBits)0x00000200)
+#define WB_CLOSEABLE ((WinBits)0x00000400)
+#define WB_STANDALONE ((WinBits)0x00000800)
+#define WB_APP ((WinBits)0x00001000)
+#define WB_PINABLE ((WinBits)0x00002000)
+#define WB_SYSTEMWINDOW ((WinBits)SAL_CONST_INT64(0x40000000))
+// warning: do not confuse WB_SYSTEMCHILDWINDOW with the SystemChildWindow class
+
+// the SystemChildWindow class was there first and is a very specialized
+// sytem child window type for plugged applications. The SystemChildWindow class
+// explicitly should never use the WB_SYSTEMCHILDWINDOW WinBit
+
+// WB_SYSTEMCHILDWINDOW on the other hand is to be used on system windows
+// which should be created as system child windows with (more or less)
+// normal event handling
+#define WB_SYSTEMCHILDWINDOW ((WinBits)SAL_CONST_INT64(0x8000000000))
+#define WB_SIZEMOVE (WB_SIZEABLE | WB_MOVEABLE)
+
+// Standard-Window-Bits fuer ChildWindows
+#define WB_TABSTOP ((WinBits)0x00000100)
+#define WB_NOTABSTOP ((WinBits)0x00000200)
+#define WB_GROUP ((WinBits)0x00000400)
+#define WB_NOGROUP ((WinBits)0x00000800)
+#define WB_HORZ ((WinBits)0x00001000)
+#define WB_VERT ((WinBits)0x00002000)
+#define WB_LEFT ((WinBits)0x00004000)
+#define WB_CENTER ((WinBits)0x00008000)
+#define WB_RIGHT ((WinBits)0x00010000)
+#define WB_TOP ((WinBits)0x00020000)
+#define WB_VCENTER ((WinBits)0x00040000)
+#define WB_BOTTOM ((WinBits)0x00080000)
+#define WB_DRAG ((WinBits)0x00100000)
+#define WB_SPIN ((WinBits)0x00200000)
+#define WB_REPEAT ((WinBits)0x00400000)
+#define WB_NOPOINTERFOCUS ((WinBits)0x00800000)
+#define WB_WORDBREAK ((WinBits)0x01000000)
+#define WB_NOLABEL ((WinBits)0x02000000)
+#define WB_SORT ((WinBits)0x04000000)
+#define WB_DROPDOWN ((WinBits)0x08000000)
+#define WB_AUTOHSCROLL ((WinBits)SAL_CONST_INT64(0x10000000))
+#define WB_DOCKABLE ((WinBits)SAL_CONST_INT64(0x20000000))
+#define WB_AUTOVSCROLL ((WinBits)SAL_CONST_INT64(0x40000000))
+#define WB_HYPHENATION (((WinBits)SAL_CONST_INT64(0x80000000)) | WB_WORDBREAK)
+#define WB_CHILDDLGCTRL ((WinBits)SAL_CONST_INT64(0x100000000000))
+
+// system floating window
+#define WB_SYSTEMFLOATWIN ((WinBits)SAL_CONST_INT64(0x100000000))
+#define WB_INTROWIN ((WinBits)SAL_CONST_INT64(0x200000000))
+#define WB_NOSHADOW ((WinBits)SAL_CONST_INT64(0x400000000))
+#define WB_TOOLTIPWIN ((WinBits)SAL_CONST_INT64(0x800000000))
+#define WB_OWNERDRAWDECORATION ((WinBits)SAL_CONST_INT64(0x2000000000))
+#define WB_DEFAULTWIN ((WinBits)SAL_CONST_INT64(0x4000000000))
+#define WB_NEEDSFOCUS ((WinBits)SAL_CONST_INT64(0x1000000000))
+
+#define WB_HIDE ((WinBits)SAL_CONST_INT64(0x80000000))
+#define WB_HSCROLL WB_HORZ
+#define WB_VSCROLL WB_VERT
+#define WB_TOPIMAGE WB_TOP
+
+// Window-Bits for PushButtons
+#define WB_DEFBUTTON ((WinBits)0x10000000)
+#define WB_NOLIGHTBORDER ((WinBits)0x20000000)
+#define WB_RECTSTYLE ((WinBits)0x08000000)
+#define WB_SMALLSTYLE ((WinBits)0x04000000)
+#define WB_TOGGLE ((WinBits)SAL_CONST_INT64(0x1000000000))
+#define WB_BEVELBUTTON ((WinBits)SAL_CONST_INT64(0x2000000000))
+
+// Window-Bits for FixedText
+#define WB_PATHELLIPSIS ((WinBits)0x00100000)
+#define WB_EXTRAOFFSET ((WinBits)0x02000000)
+#define WB_NOMULTILINE ((WinBits)0x10000000)
+#define WB_INFO ((WinBits)0x20000000)
+
+// Window-Bits for CheckBox
+#define WB_CBLINESTYLE ((WinBits)SAL_CONST_INT64(0x2000000000))
+
+// Window-Bits for Edit
+#define WB_PASSWORD ((WinBits)0x01000000)
+#define WB_READONLY ((WinBits)0x02000000)
+#define WB_NOHIDESELECTION ((WinBits)SAL_CONST_INT64(0x1000000000))
+#define WB_FORCECTRLBACKGROUND ((WinBits)0x80000000)
+
+// Window-Bits for MultiLineEdit
+#define WB_IGNORETAB ((WinBits)0x20000000)
+
+// Window-Bits for ListBox and MultiListBox
+#define WB_SIMPLEMODE ((WinBits)0x20000000)
+
+// Window-Bits for FixedBitmap
+#define WB_FAST ((WinBits)0x04000000)
+#define WB_SCALE ((WinBits)0x08000000)
+#define WB_TOPLEFTVISIBLE ((WinBits)0x10000000)
+
+// Window-Bits for ToolBox
+#define WB_LINESPACING ((WinBits)0x01000000)
+#define WB_SCROLL ((WinBits)0x02000000)
+#define WB_FORCETABCYCLE ((WinBits)0x04000000)
+
+// Window-Bits for TabControl
+#define WB_SINGLELINE ((WinBits)0x02000000)
+
+// Window-Bits for DockingWindows
+#define WB_DOCKBORDER ((WinBits)0x00001000)
+
+// Window-Bits for SplitWindow
+#define WB_NOSPLITDRAW ((WinBits)0x01000000)
+#define WB_FLATSPLITDRAW ((WinBits)0x02000000)
+
+// Window-Bits for MessageBoxen
+#define WB_OK ((WinBits)0x00100000)
+#define WB_OK_CANCEL ((WinBits)0x00200000)
+#define WB_YES_NO ((WinBits)0x00400000)
+#define WB_YES_NO_CANCEL ((WinBits)0x00800000)
+#define WB_RETRY_CANCEL ((WinBits)0x01000000)
+#define WB_DEF_OK ((WinBits)0x02000000)
+#define WB_DEF_CANCEL ((WinBits)0x04000000)
+#define WB_DEF_RETRY ((WinBits)0x08000000)
+#define WB_DEF_YES ((WinBits)SAL_CONST_INT64(0x10000000))
+#define WB_DEF_NO ((WinBits)SAL_CONST_INT64(0x20000000))
+#define WB_ABORT_RETRY_IGNORE ((WinBits)SAL_CONST_INT64(0x1000000000))
+#define WB_DEF_IGNORE ((WinBits)SAL_CONST_INT64(0x2000000000))
+
+// Standard-WinBits
+#define WB_STDWORK (WB_SIZEMOVE | WB_CLOSEABLE)
+#define WB_STDDOCKWIN (WB_DOCKABLE | WB_MOVEABLE | WB_CLOSEABLE)
+#define WB_STDFLOATWIN (WB_SIZEMOVE | WB_CLOSEABLE | WB_ROLLABLE)
+#define WB_STDDIALOG (WB_MOVEABLE | WB_CLOSEABLE)
+#define WB_STDMODELESS (WB_STDDIALOG)
+#define WB_STDMODAL (WB_STDDIALOG)
+#define WB_STDTABDIALOG (WB_STDDIALOG)
+#define WB_STDTABCONTROL 0
+
+// For TreeListBox
+#define WB_HASBUTTONS ((WinBits)0x00800000)
+#define WB_HASLINES ((WinBits)0x01000000)
+#define WB_HASLINESATROOT ((WinBits)0x02000000)
+
+// For FileOpen Dialog
+#define WB_PATH ((WinBits)0x00100000)
+#define WB_OPEN ((WinBits)0x00200000)
+#define WB_SAVEAS ((WinBits)0x00400000)
+
+// For Slider
+// Window-Bits for TabControl
+#define WB_SLIDERSET ((WinBits)0x02000000)
+
+
+// --------------------
+// - extended WinBits -
+// --------------------
+#define WB_EXT_DOCUMENT ((WinBits)0x00000001)
+#define WB_EXT_DOCMODIFIED ((WinBits)0x00000002)
+
+// ---------------
+// - WindowAlign -
+// ---------------
+
+// By changes you must also change: rsc/vclrsc.hxx
+enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM };
+enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM,
+ IMAGEALIGN_LEFT_TOP, IMAGEALIGN_LEFT_BOTTOM, IMAGEALIGN_TOP_LEFT,
+ IMAGEALIGN_TOP_RIGHT, IMAGEALIGN_RIGHT_TOP, IMAGEALIGN_RIGHT_BOTTOM,
+ IMAGEALIGN_BOTTOM_LEFT, IMAGEALIGN_BOTTOM_RIGHT, IMAGEALIGN_CENTER };
+enum SymbolAlign { SYMBOLALIGN_LEFT, SYMBOLALIGN_RIGHT };
+
+// ------------
+// - TriState -
+// ------------
+
+// By changes you must also change: rsc/vclrsc.hxx
+enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
+
+
+// ----------------------
+// - ButtonDialog-Types -
+// ----------------------
+
+typedef USHORT StandardButtonType;
+#define BUTTON_OK ((StandardButtonType)0)
+#define BUTTON_CANCEL ((StandardButtonType)1)
+#define BUTTON_YES ((StandardButtonType)2)
+#define BUTTON_NO ((StandardButtonType)3)
+#define BUTTON_RETRY ((StandardButtonType)4)
+#define BUTTON_HELP ((StandardButtonType)5)
+#define BUTTON_CLOSE ((StandardButtonType)6)
+#define BUTTON_MORE ((StandardButtonType)7)
+#define BUTTON_IGNORE ((StandardButtonType)8)
+#define BUTTON_ABORT ((StandardButtonType)9)
+#define BUTTON_LESS ((StandardButtonType)10)
+#define BUTTON_COUNT 11
+
+#endif // _TOOLS_WINTYPES_HXX
+
diff --git a/tools/prj/d.lst b/tools/prj/d.lst
index e8fde61686a4..3208ecbb3168 100644
--- a/tools/prj/d.lst
+++ b/tools/prj/d.lst
@@ -34,7 +34,11 @@ mkdir: %_DEST%\inc%_EXT%\bootstrp
..\inc\tools\postx.h %_DEST%\inc%_EXT%\tools\postx.h
..\inc\tools\prex.h %_DEST%\inc%_EXT%\tools\prex.h
-..\inc\tools\agapi.hxx %_DEST%\inc%_EXT%\tools\agapi.hxx
+..\inc\tools\solarmutex.hxx %_DEST%\inc%_EXT%\tools\solarmutex.hxx
+..\inc\tools\wintypes.hxx %_DEST%\inc%_EXT%\tools\wintypes.hxx
+..\inc\tools\mapunit.hxx %_DEST%\inc%_EXT%\tools\mapunit.hxx
+..\inc\tools\fldunit.hxx %_DEST%\inc%_EXT%\tools\fldunit.hxx
+..\inc\tools\fontenum.hxx %_DEST%\inc%_EXT%\tools\fontenum.hxx
..\inc\tools\agapi.hxx %_DEST%\inc%_EXT%\tools\agapi.hxx
..\inc\tools\agitem.hxx %_DEST%\inc%_EXT%\tools\agitem.hxx
..\inc\tools\appendunixshellword.hxx %_DEST%\inc%_EXT%\tools\appendunixshellword.hxx
diff --git a/tools/qa/makefile.mk b/tools/qa/makefile.mk
index 15f9c6a9fdaf..c63aa966b7fc 100644
--- a/tools/qa/makefile.mk
+++ b/tools/qa/makefile.mk
@@ -40,7 +40,7 @@ DLLPRE = # no leading "lib" on .so files
SHL1TARGET = test_pathutils
SHL1OBJS = $(SLO)$/test_pathutils.obj $(SLO)$/pathutils.obj
-SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB)
+SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB) $(TESTSHL2LIB)
SHL1VERSIONMAP = version.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
@@ -52,4 +52,4 @@ SLOFILES = $(SHL1OBJS)
ALLTAR: test
test .PHONY: $(SHL1TARGETN)
- testshl2 $(SHL1TARGETN) -forward $(BIN)$/$(TARGET).rdb
+ $(TESTSHL2) $(SHL1TARGETN) -forward $(BIN)$/$(TARGET).rdb
diff --git a/tools/qa/test_pathutils.cxx b/tools/qa/test_pathutils.cxx
index 9cd4e2110937..c028a2f654c4 100644
--- a/tools/qa/test_pathutils.cxx
+++ b/tools/qa/test_pathutils.cxx
@@ -33,7 +33,7 @@
#include <cwchar>
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "tools/pathutils.hxx"
namespace {
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index 7f204d5e46da..5f0d7f3ebe1d 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -88,7 +88,7 @@ inline USHORT DaysInMonth( USHORT nMonth, USHORT nYear )
// -----------------------------------------------------------------------
-static long DateToDays( USHORT nDay, USHORT nMonth, USHORT nYear )
+long Date::DateToDays( USHORT nDay, USHORT nMonth, USHORT nYear )
{
long nDays;
@@ -489,9 +489,9 @@ Date operator -( const Date& rDate, long nDays )
long operator -( const Date& rDate1, const Date& rDate2 )
{
- ULONG nTempDays1 = DateToDays( rDate1.GetDay(), rDate1.GetMonth(),
+ ULONG nTempDays1 = Date::DateToDays( rDate1.GetDay(), rDate1.GetMonth(),
rDate1.GetYear() );
- ULONG nTempDays2 = DateToDays( rDate2.GetDay(), rDate2.GetMonth(),
+ ULONG nTempDays2 = Date::DateToDays( rDate2.GetDay(), rDate2.GetMonth(),
rDate2.GetYear() );
return nTempDays1 - nTempDays2;
}
diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx
index 76910683df13..4a2e3c6ad76a 100644
--- a/tools/source/fsys/unx.cxx
+++ b/tools/source/fsys/unx.cxx
@@ -36,7 +36,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <utime.h>
-#if defined HPUX || defined LINUX || defined IRIX
+#if defined HPUX || defined LINUX
#include <mntent.h>
#define mnttab mntent
#elif defined SCO
diff --git a/tools/source/fsys/wntmsc.cxx b/tools/source/fsys/wntmsc.cxx
index 0e8e5ebc7918..153fbf37de2e 100644
--- a/tools/source/fsys/wntmsc.cxx
+++ b/tools/source/fsys/wntmsc.cxx
@@ -91,7 +91,7 @@ struct dirent *readdir( DIR *pDir )
pDir->h = FindFirstFile( pBuf, &pDir->aDirEnt );
bOk = pDir->h != INVALID_HANDLE_VALUE;
pDir->p = NULL;
- delete pBuf;
+ delete [] pBuf;
}
else
pDir->h = INVALID_HANDLE_VALUE;
diff --git a/tools/source/generic/line.cxx b/tools/source/generic/line.cxx
index 5e698d50c006..d86ff82cb739 100644
--- a/tools/source/generic/line.cxx
+++ b/tools/source/generic/line.cxx
@@ -39,11 +39,6 @@
#include <cstdlib>
#include <math.h>
-inline long FRound( double fVal )
-{
- return( fVal > 0.0 ? (long) ( fVal + 0.5 ) : -(long) ( -fVal + 0.5 ) );
-}
-
// --------
// - Line -
// --------
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 5cca29b3066e..509d2ab4969d 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -957,59 +957,6 @@ void Polygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
}
}
-// -----------------------------------------------------------------------
-
-void Polygon::GetSimple( Polygon& rResult ) const
-{
- if( !mpImplPolygon->mpFlagAry )
- rResult = *this;
- else
- {
- ::std::vector< Point > aPointVector;
-
- for( USHORT i = 0, nCount = GetSize(); i < nCount; )
- {
- if( ( ( i + 3 ) < nCount ) &&
- ( POLY_NORMAL == mpImplPolygon->mpFlagAry[ i ] ) &&
- ( POLY_CONTROL == mpImplPolygon->mpFlagAry[ i + 1 ] ) &&
- ( POLY_CONTROL == mpImplPolygon->mpFlagAry[ i + 2 ] ) &&
- ( POLY_NORMAL == mpImplPolygon->mpFlagAry[ i + 3 ] ) )
- {
- const USHORT nSegmentPoints = 25;
- const Polygon aSegmentPoly( mpImplPolygon->mpPointAry[ i ], mpImplPolygon->mpPointAry[ i + 1 ],
- mpImplPolygon->mpPointAry[ i + 3 ], mpImplPolygon->mpPointAry[ i + 2 ],
- nSegmentPoints );
- const USHORT nSegmentSize = aSegmentPoly.GetSize();
-
- if( nSegmentSize )
- {
- const Point* pPointArray = aSegmentPoly.mpImplPolygon->mpPointAry;
- const Point* pCur = pPointArray;
- const Point* pLast;
-
- aPointVector.push_back( *( pLast = pCur ) );
-
- for( USHORT j = 1; j < nSegmentSize; j++ )
- if( *( pCur = pPointArray + j ) != *pLast )
- aPointVector.push_back( *( pLast = pCur ) );
- }
-
- i += 3;
- }
- else
- aPointVector.push_back( mpImplPolygon->mpPointAry[ i++ ] );
- }
-
- // fill result polygon
- rResult = Polygon( (USHORT)aPointVector.size() );
- ::std::vector< Point >::iterator aIter( aPointVector.begin() ), aEnd( aPointVector.end() );
- Point* pPointArray = rResult.mpImplPolygon->mpPointAry;
- USHORT nPoints = rResult.mpImplPolygon->mnPoints;
- while( nPoints-- && aIter != aEnd )
- *pPointArray++ = *aIter++;
- }
-}
-
// =======================================================================
/* Recursively subdivide cubic bezier curve via deCasteljau.
@@ -1668,7 +1615,16 @@ void Polygon::Clip( const Rectangle& rRect, BOOL bPolygon )
Rectangle Polygon::GetBoundRect() const
{
DBG_CHKTHIS( Polygon, NULL );
- DBG_ASSERT( !mpImplPolygon->mpFlagAry, "GetBoundRect could fail with beziers!" );
+ // Removing the assert. Bezier curves have the attribute that each single
+ // curve segment defined by four points can not exit the four-point polygon
+ // defined by that points. This allows to say that the curve segment can also
+ // never leave the Range of it's defining points.
+ // The result is that Polygon::GetBoundRect() may not create the minimal
+ // BoundRect of the Polygon (to get that, use basegfx::B2DPolygon classes),
+ // but will always create a valid BoundRect, at least as long as this method
+ // 'blindly' travels over all points, including control points.
+ //
+ // DBG_ASSERT( !mpImplPolygon->mpFlagAry, "GetBoundRect could fail with beziers!" );
USHORT nCount = mpImplPolygon->mnPoints;
if( ! nCount )
diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx
index ff97e6006a41..692e47a9d1d2 100644
--- a/tools/source/generic/poly2.cxx
+++ b/tools/source/generic/poly2.cxx
@@ -346,23 +346,6 @@ void PolyPolygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData
// -----------------------------------------------------------------------
-void PolyPolygon::GetSimple( PolyPolygon& rResult ) const
-{
- DBG_CHKTHIS( PolyPolygon, NULL );
-
- rResult.Clear();
-
- Polygon aPolygon;
-
- for( USHORT i = 0; i < mpImplPolyPolygon->mnCount; i++ )
- {
- mpImplPolyPolygon->mpPolyAry[ i ]->GetSimple( aPolygon );
- rResult.Insert( aPolygon );
- }
-}
-
-// -----------------------------------------------------------------------
-
void PolyPolygon::AdaptiveSubdivide( PolyPolygon& rResult, const double d ) const
{
DBG_CHKTHIS( PolyPolygon, NULL );
diff --git a/tools/source/memtools/table.cxx b/tools/source/memtools/table.cxx
index ba0dbb8a90f9..75aafddb6c58 100644
--- a/tools/source/memtools/table.cxx
+++ b/tools/source/memtools/table.cxx
@@ -125,26 +125,37 @@ BOOL Table::Insert( ULONG nKey, void* p )
{
USHORT n = 0;
USHORT nTempCount = (USHORT)nCount * 2;
- void** pNodes = Container::ImpGetOnlyNodes();
- ULONG nCompareKey = (ULONG)(*pNodes);
- while ( nKey > nCompareKey )
+ //<!--Modified by PengYunQuan for resolving a NULL pointer access
+
+ if( void** pNodes = Container::ImpGetOnlyNodes() )
{
- n += 2;
- pNodes += 2;
- if ( n < nTempCount )
- nCompareKey = (ULONG)(*pNodes);
- else
+ ULONG nCompareKey = (ULONG)(*pNodes);
+ while ( nKey > nCompareKey )
{
- nCompareKey = 0;
- break;
+ n += 2;
+ pNodes += 2;
+ if ( n < nTempCount )
+ nCompareKey = (ULONG)(*pNodes);
+ else
+ {
+ nCompareKey = 0;
+ break;
+ }
}
- }
- // Testen, ob sich der Key schon in der Tabelle befindet
- if ( nKey == nCompareKey )
- return FALSE;
+ // Testen, ob sich der Key schon in der Tabelle befindet
+ if ( nKey == nCompareKey )
+ return FALSE;
- i = n;
+ i = n;
+ }
+ else
+ {
+ i = 0;
+ if ( ImplGetIndex( nKey, &i ) != TABLE_ENTRY_NOTFOUND )
+ return FALSE;
+ }
+ //-->Modified by PengYunQuan for resolving a NULL pointer access
}
else
{
diff --git a/tools/source/misc/makefile.mk b/tools/source/misc/makefile.mk
index 7742c471445f..adc098b023b8 100644
--- a/tools/source/misc/makefile.mk
+++ b/tools/source/misc/makefile.mk
@@ -42,9 +42,10 @@ LIB1TARGET = $(SLB)$/$(TARGET).lib
LIB1OBJFILES = \
$(SLO)$/appendunixshellword.obj \
$(SLO)$/extendapplicationenvironment.obj \
+ $(SLO)$/solarmutex.obj \
$(SLO)$/getprocessworkingdir.obj
OBJFILES = $(OBJ)$/pathutils.obj
-SLOFILES = $(SLO)$/pathutils.obj $(LIB1OBJFILES)
+SLOFILES = $(SLO)$/pathutils.obj $(LIB1OBJFILES) $(SLO)$/solarmutex.obj
.INCLUDE: target.mk
diff --git a/tools/source/misc/solarmutex.cxx b/tools/source/misc/solarmutex.cxx
new file mode 100644
index 000000000000..9049c13997a9
--- /dev/null
+++ b/tools/source/misc/solarmutex.cxx
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_tools.hxx"
+#include <tools/solarmutex.hxx>
+
+namespace tools
+{
+ static ::vos::IMutex* pSolarMutex = 0;
+
+ ::vos::IMutex* SolarMutex::GetSolarMutex()
+ {
+ return pSolarMutex;
+ }
+
+ void SolarMutex::SetSolarMutex( ::vos::IMutex* pMutex )
+ {
+ pSolarMutex = pMutex;
+ }
+
+ bool SolarMutex::Acquire()
+ {
+ if ( pSolarMutex )
+ pSolarMutex->acquire();
+ else
+ return false;
+ return true;
+ }
+
+ void SolarMutex::Release()
+ {
+ if ( pSolarMutex )
+ pSolarMutex->release();
+ }
+}
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 538c02e78fde..d27fe1f7f2c0 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -745,7 +745,7 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode )
aFileCopier.Execute();
}
}
- delete pBuf;
+ delete [] pBuf;
}
}
}
diff --git a/tools/test/makefile.mk b/tools/test/makefile.mk
index 63108677829c..22796f47d72f 100644
--- a/tools/test/makefile.mk
+++ b/tools/test/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -48,19 +48,20 @@ SHL1OBJS= \
SHL1TARGET= tests
SHL1STDLIBS= $(SALLIB) \
$(TOOLSLIB) \
+ $(TESTSHL2LIB) \
$(CPPUNITLIB)
SHL1IMPLIB= i$(SHL1TARGET)
DEF1NAME =$(SHL1TARGET)
-SHL1VERSIONMAP = export.map
+SHL1VERSIONMAP = export.map
#------------------------------- All object files ----------------------------
# do this here, so we get right dependencies
-SLOFILES=$(SHL1OBJS)
+SLOFILES=$(SHL1OBJS)
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
-.INCLUDE : _cppunit.mk
+.INCLUDE : _cppunit.mk
diff --git a/tools/test/tests.cxx b/tools/test/tests.cxx
index 913bd444f145..a2bfb63d4c5f 100644
--- a/tools/test/tests.cxx
+++ b/tools/test/tests.cxx
@@ -33,7 +33,7 @@
#include "precompiled_tools.hxx"
// autogenerated file with codegen.pl
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <rtl/math.hxx>
#include <tools/fract.hxx>