1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <tools/urlobj.hxx>
22 #include <vcl/svapp.hxx>
23 #include <vcl/mapmod.hxx>
24 #include <vcl/window.hxx>
26 #include "svl/urihelper.hxx"
27 #include <svtools/imap.hxx>
28 #include <svtools/imapobj.hxx>
29 #include <svtools/imapcirc.hxx>
30 #include <svtools/imaprect.hxx>
31 #include <svtools/imappoly.hxx>
39 #define SCALEPOINT(aPT,aFracX,aFracY) (aPT).X()=((aPT).X()*(aFracX).GetNumerator())/(aFracX).GetDenominator(); \
40 (aPT).Y()=((aPT).Y()*(aFracY).GetNumerator())/(aFracY).GetDenominator();
43 /******************************************************************************/
45 sal_uInt16
IMapObject::nActualTextEncoding
= (sal_uInt16
) RTL_TEXTENCODING_DONTKNOW
;
47 /******************************************************************************/
50 IMapObject::IMapObject()
56 IMapObject::IMapObject( const String
& rURL
, const String
& rAltText
, const String
& rDesc
,
57 const String
& rTarget
, const String
& rName
, sal_Bool bURLActive
)
59 , aAltText( rAltText
)
63 , bActive( bURLActive
)
69 /******************************************************************************
71 |* Freigabe des internen Speichers
73 \******************************************************************************/
75 sal_uInt16
IMapObject::GetVersion() const
77 return IMAP_OBJ_VERSION
;
80 void IMapObject::Write( SvStream
& rOStm
, const String
& rBaseURL
) const
83 const rtl_TextEncoding eEncoding
= osl_getThreadTextEncoding();
86 rOStm
<< GetVersion();
87 rOStm
<< ( (sal_uInt16
) eEncoding
);
89 const OString aRelURL
= OUStringToOString(
90 URIHelper::simpleNormalizedMakeRelative(rBaseURL
, aURL
), eEncoding
);
91 write_lenPrefixed_uInt8s_FromOString
<sal_uInt16
>(rOStm
, aRelURL
);
92 write_lenPrefixed_uInt8s_FromOUString
<sal_uInt16
>(rOStm
, aAltText
, eEncoding
);
94 write_lenPrefixed_uInt8s_FromOUString
<sal_uInt16
>(rOStm
, aTarget
, eEncoding
);
96 pCompat
= new IMapCompat( rOStm
, STREAM_WRITE
);
98 WriteIMapObject( rOStm
);
99 aEventList
.Write( rOStm
); // V4
100 write_lenPrefixed_uInt8s_FromOUString
<sal_uInt16
>(rOStm
, aName
, eEncoding
); // V5
106 /******************************************************************************
110 \******************************************************************************/
112 void IMapObject::Read( SvStream
& rIStm
, const String
& rBaseURL
)
115 rtl_TextEncoding nTextEncoding
;
117 // Typ und Version ueberlesen wir
119 rIStm
>> nReadVersion
;
120 rIStm
>> nTextEncoding
;
121 aURL
= read_lenPrefixed_uInt8s_ToOUString
<sal_uInt16
>(rIStm
, nTextEncoding
);
122 aAltText
= read_lenPrefixed_uInt8s_ToOUString
<sal_uInt16
>(rIStm
, nTextEncoding
);
124 aTarget
= read_lenPrefixed_uInt8s_ToOUString
<sal_uInt16
>(rIStm
, nTextEncoding
);
126 // URL absolut machen
127 aURL
= URIHelper::SmartRel2Abs( INetURLObject(rBaseURL
), aURL
, URIHelper::GetMaybeFileHdl(), true, false, INetURLObject::WAS_ENCODED
, INetURLObject::DECODE_UNAMBIGUOUS
);
128 pCompat
= new IMapCompat( rIStm
, STREAM_READ
);
130 ReadIMapObject( rIStm
);
132 // ab Version 4 lesen wir eine EventListe
133 if ( nReadVersion
>= 0x0004 )
135 aEventList
.Read(rIStm
);
137 // ab Version 5 kann ein Objektname vorhanden sein
138 if ( nReadVersion
>= 0x0005 )
139 aName
= read_lenPrefixed_uInt8s_ToOUString
<sal_uInt16
>(rIStm
, nTextEncoding
);
145 sal_Bool
IMapObject::IsEqual( const IMapObject
& rEqObj
)
147 return ( ( aURL
== rEqObj
.aURL
) &&
148 ( aAltText
== rEqObj
.aAltText
) &&
149 ( aDesc
== rEqObj
.aDesc
) &&
150 ( aTarget
== rEqObj
.aTarget
) &&
151 ( aName
== rEqObj
.aName
) &&
152 ( bActive
== rEqObj
.bActive
) );
155 IMapRectangleObject::IMapRectangleObject( const Rectangle
& rRect
,
157 const String
& rAltText
,
159 const String
& rTarget
,
162 sal_Bool bPixelCoords
) :
163 IMapObject ( rURL
, rAltText
, rDesc
, rTarget
, rName
, bURLActive
)
165 ImpConstruct( rRect
, bPixelCoords
);
168 void IMapRectangleObject::ImpConstruct( const Rectangle
& rRect
, sal_Bool bPixel
)
171 aRect
= Application::GetDefaultDevice()->PixelToLogic( rRect
, MapMode( MAP_100TH_MM
) );
177 /******************************************************************************
181 \******************************************************************************/
183 void IMapRectangleObject::WriteIMapObject( SvStream
& rOStm
) const
189 /******************************************************************************
193 \******************************************************************************/
195 void IMapRectangleObject::ReadIMapObject( SvStream
& rIStm
)
201 /******************************************************************************
205 \******************************************************************************/
207 sal_uInt16
IMapRectangleObject::GetType() const
209 return IMAP_OBJ_RECTANGLE
;
213 /******************************************************************************
217 \******************************************************************************/
219 sal_Bool
IMapRectangleObject::IsHit( const Point
& rPoint
) const
221 return aRect
.IsInside( rPoint
);
224 Rectangle
IMapRectangleObject::GetRectangle( sal_Bool bPixelCoords
) const
229 aNewRect
= Application::GetDefaultDevice()->LogicToPixel( aRect
, MapMode( MAP_100TH_MM
) );
236 void IMapRectangleObject::Scale( const Fraction
& rFracX
, const Fraction
& rFracY
)
238 Point
aTL( aRect
.TopLeft() );
239 Point
aBR( aRect
.BottomRight() );
241 if ( rFracX
.GetDenominator() && rFracY
.GetDenominator() )
243 SCALEPOINT( aTL
, rFracX
, rFracY
);
244 SCALEPOINT( aBR
, rFracX
, rFracY
);
247 aRect
= Rectangle( aTL
, aBR
);
250 sal_Bool
IMapRectangleObject::IsEqual( const IMapRectangleObject
& rEqObj
)
252 return ( IMapObject::IsEqual( rEqObj
) && ( aRect
== rEqObj
.aRect
) );
255 IMapCircleObject::IMapCircleObject( const Point
& rCenter
, sal_uLong nCircleRadius
,
257 const String
& rAltText
,
259 const String
& rTarget
,
262 sal_Bool bPixelCoords
) :
263 IMapObject ( rURL
, rAltText
, rDesc
, rTarget
, rName
, bURLActive
)
265 ImpConstruct( rCenter
, nCircleRadius
, bPixelCoords
);
268 void IMapCircleObject::ImpConstruct( const Point
& rCenter
, sal_uLong nRad
, sal_Bool bPixel
)
272 MapMode
aMap100( MAP_100TH_MM
);
274 aCenter
= Application::GetDefaultDevice()->PixelToLogic( rCenter
, aMap100
);
275 nRadius
= Application::GetDefaultDevice()->PixelToLogic( Size( nRad
, 0 ), aMap100
).Width();
285 /******************************************************************************
289 \******************************************************************************/
291 void IMapCircleObject::WriteIMapObject( SvStream
& rOStm
) const
293 sal_uInt32 nTmp
= nRadius
;
300 /******************************************************************************
304 \******************************************************************************/
306 void IMapCircleObject::ReadIMapObject( SvStream
& rIStm
)
317 /******************************************************************************
321 \******************************************************************************/
323 sal_uInt16
IMapCircleObject::GetType() const
325 return IMAP_OBJ_CIRCLE
;
329 /******************************************************************************
333 \******************************************************************************/
335 sal_Bool
IMapCircleObject::IsHit( const Point
& rPoint
) const
337 const Point
aPoint( aCenter
- rPoint
);
338 sal_Bool bRet
= sal_False
;
340 if ( (sal_Int32
) sqrt( (double) aPoint
.X() * aPoint
.X() +
341 aPoint
.Y() * aPoint
.Y() ) <= nRadius
)
349 Point
IMapCircleObject::GetCenter( sal_Bool bPixelCoords
) const
354 aNewPoint
= Application::GetDefaultDevice()->LogicToPixel( aCenter
, MapMode( MAP_100TH_MM
) );
361 sal_uLong
IMapCircleObject::GetRadius( sal_Bool bPixelCoords
) const
363 sal_uLong nNewRadius
;
366 nNewRadius
= Application::GetDefaultDevice()->LogicToPixel( Size( nRadius
, 0 ), MapMode( MAP_100TH_MM
) ).Width();
368 nNewRadius
= nRadius
;
373 Rectangle
IMapCircleObject::GetBoundRect() const
375 long nWidth
= nRadius
<< 1;
377 return Rectangle( Point( aCenter
.X() - nRadius
, aCenter
.Y() - nRadius
),
378 Size( nWidth
, nWidth
) );
381 void IMapCircleObject::Scale( const Fraction
& rFracX
, const Fraction
& rFracY
)
383 Fraction
aAverage( rFracX
);
386 aAverage
*= Fraction( 1, 2 );
388 if ( rFracX
.GetDenominator() && rFracY
.GetDenominator() )
390 SCALEPOINT( aCenter
, rFracX
, rFracY
);
393 nRadius
= ( nRadius
* aAverage
.GetNumerator() ) / aAverage
.GetDenominator();
396 sal_Bool
IMapCircleObject::IsEqual( const IMapCircleObject
& rEqObj
)
398 return ( IMapObject::IsEqual( rEqObj
) &&
399 ( aCenter
== rEqObj
.aCenter
) &&
400 ( nRadius
== rEqObj
.nRadius
) );
403 IMapPolygonObject::IMapPolygonObject( const Polygon
& rPoly
,
405 const String
& rAltText
,
407 const String
& rTarget
,
410 sal_Bool bPixelCoords
) :
411 IMapObject ( rURL
, rAltText
, rDesc
, rTarget
, rName
, bURLActive
),
412 bEllipse ( sal_False
)
414 ImpConstruct( rPoly
, bPixelCoords
);
417 void IMapPolygonObject::ImpConstruct( const Polygon
& rPoly
, sal_Bool bPixel
)
420 aPoly
= Application::GetDefaultDevice()->PixelToLogic( rPoly
, MapMode( MAP_100TH_MM
) );
426 /******************************************************************************
430 \******************************************************************************/
432 void IMapPolygonObject::WriteIMapObject( SvStream
& rOStm
) const
435 rOStm
<< bEllipse
; // >= Version 2
436 rOStm
<< aEllipse
; // >= Version 2
440 /******************************************************************************
444 \******************************************************************************/
446 void IMapPolygonObject::ReadIMapObject( SvStream
& rIStm
)
450 // Version >= 2 hat zusaetzlich Ellipsen-Information
451 if ( nReadVersion
>= 2 )
459 /******************************************************************************
463 \******************************************************************************/
465 sal_uInt16
IMapPolygonObject::GetType() const
467 return IMAP_OBJ_POLYGON
;
471 /******************************************************************************
475 \******************************************************************************/
477 sal_Bool
IMapPolygonObject::IsHit( const Point
& rPoint
) const
479 return aPoly
.IsInside( rPoint
);
482 Polygon
IMapPolygonObject::GetPolygon( sal_Bool bPixelCoords
) const
487 aNewPoly
= Application::GetDefaultDevice()->LogicToPixel( aPoly
, MapMode( MAP_100TH_MM
) );
494 void IMapPolygonObject::SetExtraEllipse( const Rectangle
& rEllipse
)
496 if ( aPoly
.GetSize() )
503 void IMapPolygonObject::Scale( const Fraction
& rFracX
, const Fraction
& rFracY
)
505 sal_uInt16 nCount
= aPoly
.GetSize();
507 for ( sal_uInt16 i
= 0; i
< nCount
; i
++ )
509 Point
aScaledPt( aPoly
[ i
] );
511 if ( rFracX
.GetDenominator() && rFracY
.GetDenominator() )
513 SCALEPOINT( aScaledPt
, rFracX
, rFracY
);
516 aPoly
[ i
] = aScaledPt
;
521 Point
aTL( aEllipse
.TopLeft() );
522 Point
aBR( aEllipse
.BottomRight() );
524 if ( rFracX
.GetDenominator() && rFracY
.GetDenominator() )
526 SCALEPOINT( aTL
, rFracX
, rFracY
);
527 SCALEPOINT( aBR
, rFracX
, rFracY
);
530 aEllipse
= Rectangle( aTL
, aBR
);
534 sal_Bool
IMapPolygonObject::IsEqual( const IMapPolygonObject
& rEqObj
)
536 sal_Bool bRet
= sal_False
;
538 if ( IMapObject::IsEqual( rEqObj
) )
540 const Polygon
& rEqPoly
= rEqObj
.aPoly
;
541 const sal_uInt16 nCount
= aPoly
.GetSize();
542 const sal_uInt16 nEqCount
= rEqPoly
.GetSize();
543 sal_Bool bDifferent
= sal_False
;
545 if ( nCount
== nEqCount
)
547 for ( sal_uInt16 i
= 0; i
< nCount
; i
++ )
549 if ( aPoly
[ i
] != rEqPoly
[ i
] )
551 bDifferent
= sal_True
;
564 /******************************************************************************
568 \******************************************************************************/
570 ImageMap::ImageMap( const String
& rName
)
576 /******************************************************************************
580 \******************************************************************************/
582 ImageMap::ImageMap( const ImageMap
& rImageMap
)
584 DBG_CTOR( ImageMap
, NULL
);
586 size_t nCount
= rImageMap
.GetIMapObjectCount();
588 for ( size_t i
= 0; i
< nCount
; i
++ )
590 IMapObject
* pCopyObj
= rImageMap
.GetIMapObject( i
);
592 switch( pCopyObj
->GetType() )
594 case( IMAP_OBJ_RECTANGLE
):
595 maList
.push_back( new IMapRectangleObject( *(IMapRectangleObject
*) pCopyObj
) );
598 case( IMAP_OBJ_CIRCLE
):
599 maList
.push_back( new IMapCircleObject( *(IMapCircleObject
*) pCopyObj
) );
602 case( IMAP_OBJ_POLYGON
):
603 maList
.push_back( new IMapPolygonObject( *(IMapPolygonObject
*) pCopyObj
) );
611 aName
= rImageMap
.aName
;
615 /******************************************************************************
619 \******************************************************************************/
621 ImageMap::~ImageMap()
623 DBG_DTOR( ImageMap
, NULL
);
629 /******************************************************************************
631 |* Freigabe des internen Speichers
633 \******************************************************************************/
635 void ImageMap::ClearImageMap()
637 for( size_t i
= 0, n
= maList
.size(); i
< n
; ++i
)
645 /******************************************************************************
647 |* Zuweisungsoperator
649 \******************************************************************************/
651 ImageMap
& ImageMap::operator=( const ImageMap
& rImageMap
)
653 size_t nCount
= rImageMap
.GetIMapObjectCount();
657 for ( size_t i
= 0; i
< nCount
; i
++ )
659 IMapObject
* pCopyObj
= rImageMap
.GetIMapObject( i
);
661 switch( pCopyObj
->GetType() )
663 case( IMAP_OBJ_RECTANGLE
):
664 maList
.push_back( new IMapRectangleObject( *(IMapRectangleObject
*) pCopyObj
) );
667 case( IMAP_OBJ_CIRCLE
):
668 maList
.push_back( new IMapCircleObject( *(IMapCircleObject
*) pCopyObj
) );
671 case( IMAP_OBJ_POLYGON
):
672 maList
.push_back( new IMapPolygonObject( *(IMapPolygonObject
*) pCopyObj
) );
680 aName
= rImageMap
.aName
;
686 /******************************************************************************
688 |* Vergleichsoperator I
690 \******************************************************************************/
692 sal_Bool
ImageMap::operator==( const ImageMap
& rImageMap
)
694 const size_t nCount
= maList
.size();
695 const size_t nEqCount
= rImageMap
.GetIMapObjectCount();
696 sal_Bool bRet
= sal_False
;
698 if ( nCount
== nEqCount
)
700 sal_Bool bDifferent
= ( aName
!= rImageMap
.aName
);
702 for ( size_t i
= 0; ( i
< nCount
) && !bDifferent
; i
++ )
704 IMapObject
* pObj
= maList
[ i
];
705 IMapObject
* pEqObj
= rImageMap
.GetIMapObject( i
);
707 if ( pObj
->GetType() == pEqObj
->GetType() )
709 switch( pObj
->GetType() )
711 case( IMAP_OBJ_RECTANGLE
):
713 if ( !( (IMapRectangleObject
*) pObj
)->IsEqual( *(IMapRectangleObject
*) pEqObj
) )
714 bDifferent
= sal_True
;
718 case( IMAP_OBJ_CIRCLE
):
720 if ( !( (IMapCircleObject
*) pObj
)->IsEqual( *(IMapCircleObject
*) pEqObj
) )
721 bDifferent
= sal_True
;
725 case( IMAP_OBJ_POLYGON
):
727 if ( !( (IMapPolygonObject
*) pObj
)->IsEqual( *(IMapPolygonObject
*) pEqObj
) )
728 bDifferent
= sal_True
;
737 bDifferent
= sal_True
;
748 /******************************************************************************
750 |* Vergleichsoperator II
752 \******************************************************************************/
754 sal_Bool
ImageMap::operator!=( const ImageMap
& rImageMap
)
756 return !( *this == rImageMap
);
760 /******************************************************************************
762 |* Freigabe des internen Speichers
764 \******************************************************************************/
766 sal_uInt16
ImageMap::GetVersion() const
768 return IMAGE_MAP_VERSION
;
772 /******************************************************************************
774 |* Einfuegen eines neuen Objekts
776 \******************************************************************************/
778 void ImageMap::InsertIMapObject( const IMapObject
& rIMapObject
)
780 switch( rIMapObject
.GetType() )
782 case( IMAP_OBJ_RECTANGLE
):
783 maList
.push_back( new IMapRectangleObject( (IMapRectangleObject
&) rIMapObject
) );
786 case( IMAP_OBJ_CIRCLE
):
787 maList
.push_back( new IMapCircleObject( (IMapCircleObject
&) rIMapObject
) );
790 case( IMAP_OBJ_POLYGON
):
791 maList
.push_back( new IMapPolygonObject( (IMapPolygonObject
&) rIMapObject
) );
800 /******************************************************************************
804 \******************************************************************************/
806 IMapObject
* ImageMap::GetHitIMapObject( const Size
& rTotalSize
,
807 const Size
& rDisplaySize
,
808 const Point
& rRelHitPoint
,
811 Point
aRelPoint( rTotalSize
.Width() * rRelHitPoint
.X() / rDisplaySize
.Width(),
812 rTotalSize
.Height() * rRelHitPoint
.Y() / rDisplaySize
.Height() );
814 // Falls Flags zur Spiegelung etc. angegeben sind, wird
815 // der zu pruefende Punkt vor der Pruefung entspr. transformiert
818 if ( nFlags
& IMAP_MIRROR_HORZ
)
819 aRelPoint
.X() = rTotalSize
.Width() - aRelPoint
.X();
821 if ( nFlags
& IMAP_MIRROR_VERT
)
822 aRelPoint
.Y() = rTotalSize
.Height() - aRelPoint
.Y();
825 // Alle Objekte durchlaufen und HitTest ausfuehren
826 IMapObject
* pObj
= NULL
;
827 for( size_t i
= 0, n
= maList
.size(); i
< n
; ++i
) {
828 if ( maList
[ i
]->IsHit( aRelPoint
) ) {
834 return( pObj
? ( pObj
->IsActive() ? pObj
: NULL
) : NULL
);
837 void ImageMap::Scale( const Fraction
& rFracX
, const Fraction
& rFracY
)
839 size_t nCount
= maList
.size();
841 for ( size_t i
= 0; i
< nCount
; i
++ )
843 IMapObject
* pObj
= maList
[ i
];
845 switch( pObj
->GetType() )
847 case( IMAP_OBJ_RECTANGLE
):
848 ( (IMapRectangleObject
*) pObj
)->Scale( rFracX
, rFracY
);
851 case( IMAP_OBJ_CIRCLE
):
852 ( (IMapCircleObject
*) pObj
)->Scale( rFracX
, rFracY
);
855 case( IMAP_OBJ_POLYGON
):
856 ( (IMapPolygonObject
*) pObj
)->Scale( rFracX
, rFracY
);
866 /******************************************************************************
868 |* Objekte nacheinander wegschreiben
870 \******************************************************************************/
872 void ImageMap::ImpWriteImageMap( SvStream
& rOStm
, const String
& rBaseURL
) const
875 size_t nCount
= maList
.size();
877 for ( size_t i
= 0; i
< nCount
; i
++ )
880 pObj
->Write( rOStm
, rBaseURL
);
885 /******************************************************************************
887 |* Objekte nacheinander lesen
889 \******************************************************************************/
891 void ImageMap::ImpReadImageMap( SvStream
& rIStm
, size_t nCount
, const String
& rBaseURL
)
893 // neue Objekte einlesen
894 for ( size_t i
= 0; i
< nCount
; i
++ )
903 case ( IMAP_OBJ_RECTANGLE
):
905 IMapRectangleObject
* pObj
= new IMapRectangleObject
;
906 pObj
->Read( rIStm
, rBaseURL
);
907 maList
.push_back( pObj
);
911 case ( IMAP_OBJ_CIRCLE
):
913 IMapCircleObject
* pObj
= new IMapCircleObject
;
914 pObj
->Read( rIStm
, rBaseURL
);
915 maList
.push_back( pObj
);
919 case ( IMAP_OBJ_POLYGON
):
921 IMapPolygonObject
* pObj
= new IMapPolygonObject
;
922 pObj
->Read( rIStm
, rBaseURL
);
923 maList
.push_back( pObj
);
934 /******************************************************************************
938 \******************************************************************************/
940 void ImageMap::Write( SvStream
& rOStm
, const String
& rBaseURL
) const
943 String
aImageName( GetName() );
944 sal_uInt16 nOldFormat
= rOStm
.GetNumberFormatInt();
945 sal_uInt16 nCount
= (sal_uInt16
) GetIMapObjectCount();
946 const rtl_TextEncoding eEncoding
= osl_getThreadTextEncoding(); //vomit!
948 rOStm
.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN
);
950 // MagicCode schreiben
952 rOStm
<< GetVersion();
953 write_lenPrefixed_uInt8s_FromOUString
<sal_uInt16
>(rOStm
, aImageName
, eEncoding
);
954 write_lenPrefixed_uInt8s_FromOString
<sal_uInt16
>(rOStm
, OString()); //dummy
956 write_lenPrefixed_uInt8s_FromOUString
<sal_uInt16
>(rOStm
, aImageName
, eEncoding
);
958 pCompat
= new IMapCompat( rOStm
, STREAM_WRITE
);
960 // hier kann in neueren Versionen eingefuegt werden
964 ImpWriteImageMap( rOStm
, rBaseURL
);
966 rOStm
.SetNumberFormatInt( nOldFormat
);
970 /******************************************************************************
974 \******************************************************************************/
976 void ImageMap::Read( SvStream
& rIStm
, const String
& rBaseURL
)
979 sal_uInt16 nOldFormat
= rIStm
.GetNumberFormatInt();
982 rIStm
.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN
);
983 rIStm
.Read( cMagic
, sizeof( cMagic
) );
985 if ( !memcmp( cMagic
, IMAPMAGIC
, sizeof( cMagic
) ) )
989 // alten Inhalt loeschen
992 // Version ueberlesen wir
995 aName
= read_lenPrefixed_uInt8s_ToOUString
<sal_uInt16
>(rIStm
, osl_getThreadTextEncoding());
996 read_lenPrefixed_uInt8s_ToOString
<sal_uInt16
>(rIStm
); // Dummy
998 read_lenPrefixed_uInt8s_ToOString
<sal_uInt16
>(rIStm
); // Dummy
1000 pCompat
= new IMapCompat( rIStm
, STREAM_READ
);
1002 // hier kann in neueren Versionen gelesen werden
1005 ImpReadImageMap( rIStm
, nCount
, rBaseURL
);
1009 rIStm
.SetError( SVSTREAM_GENERALERROR
);
1011 rIStm
.SetNumberFormatInt( nOldFormat
);
1015 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */