58 {
nullptr, IMapObjectType::Rectangle }
68 "SfxHTMLParser::SfxHTMLParser: From where comes ZS?" );
71 "SfxHTMLParser::SfxHTMLParser: Switch to UCS2?" );
85 DBG_ASSERT( pImageMap,
"ParseMapOptions: No Image-Map" );
89 for (
size_t i = rOptions.size();
i; )
92 if ( aOption.
GetToken() == HtmlOptionId::NAME )
96 if( !
aName.isEmpty() )
99 return !
aName.isEmpty();
107 DBG_ASSERT( pImageMap,
"ParseAreaOptions: no Image-Map" );
110 std::vector<sal_uInt32> aCoords;
111 OUString
aName, aHRef, aAlt, aTarget;
112 bool bNoHRef =
false;
115 for (
size_t i = rOptions.size();
i; )
122 case HtmlOptionId::NAME:
125 case HtmlOptionId::SHAPE:
128 case HtmlOptionId::COORDS:
131 case HtmlOptionId::HREF:
134 case HtmlOptionId::NOHREF:
137 case HtmlOptionId::ALT:
140 case HtmlOptionId::TARGET:
144 case HtmlOptionId::ONMOUSEOVER:
147 case HtmlOptionId::SDONMOUSEOVER:
148 nEvent = nEventMouseOver;
149 goto IMAPOBJ_SETEVENT;
151 case HtmlOptionId::ONMOUSEOUT:
154 case HtmlOptionId::SDONMOUSEOUT:
155 nEvent = nEventMouseOut;
156 goto IMAPOBJ_SETEVENT;
161 if( !sTmp.isEmpty() )
175 bool bNewArea =
true;
178 case IMapObjectType::Rectangle:
179 if( aCoords.size() >=4 )
182 aCoords[2], aCoords[3] );
183 std::unique_ptr<IMapRectangleObject> pMapRObj(
new IMapRectangleObject(aRect, aHRef, aAlt, OUString(), aTarget,
aName,
185 if( !aMacroTbl.
empty() )
186 pMapRObj->SetMacroTable( aMacroTbl );
190 case IMapObjectType::Circle:
191 if( aCoords.size() >=3 )
193 Point aPoint( aCoords[0], aCoords[1] );
194 std::unique_ptr<IMapCircleObject> pMapCObj(
new IMapCircleObject(aPoint, aCoords[2],aHRef, aAlt, OUString(),
195 aTarget,
aName, !bNoHRef ));
196 if( !aMacroTbl.
empty() )
197 pMapCObj->SetMacroTable( aMacroTbl );
201 case IMapObjectType::Polygon:
202 if( aCoords.size() >=6 )
204 sal_uInt16
nCount = aCoords.size() / 2;
207 aPoly[
i] =
Point( aCoords[2*
i], aCoords[2*
i+1] );
208 std::unique_ptr<IMapPolygonObject> pMapPObj(
new IMapPolygonObject( aPoly, aHRef, aAlt, OUString(), aTarget,
aName,
210 if( !aMacroTbl.
empty() )
211 pMapPObj->SetMacroTable( aMacroTbl );
238 DBG_ASSERT( pStream,
"No In-Stream received from Medium" );
244 sal_uInt64
const nLen = aStream.
TellEnd();
262 for(
bool bCont = pHTTPHeader->
GetFirst( aKV ); bCont;
263 bCont = pHTTPHeader->
GetNext( aKV ) )
265 if( aKV.
GetKey().equalsIgnoreAsciiCase(
271 if( aTmp.startsWithIgnoreAsciiCase(
"text/" ) )
272 aTmp = aTmp.copy( 5 );
273 else if( aTmp.startsWithIgnoreAsciiCase(
"application/" ) )
274 aTmp = aTmp.copy( 12 );
278 if( aTmp.startsWithIgnoreAsciiCase(
"x-" ) )
280 aTmp = aTmp.copy( 2 );
317 LanguageType& eNumLang,
const OUString& aValStr, std::u16string_view aNumStr,
328 OUString aFormat( aNumStr.substr( nIdx ) );
332 rFormatter.
PutEntry( aFormat, nCheckPos,
nType, nNumForm, eNumLang );
335 eParseLang, eNumLang,
true);
HtmlOptionId GetToken() const
void GetNumbers(std::vector< sal_uInt32 > &rNumbers) const
const OUString & GetString() const
EnumT GetEnum(const HTMLOptionEnum< EnumT > *pOptEnums, EnumT nDflt=static_cast< EnumT >(0)) const
static OUString GetAbsURL(std::u16string_view rTheBaseURIRef, OUString const &rTheRelURIRef, EncodeMechanism eEncodeMechanism=EncodeMechanism::WasEncoded, DecodeMechanism eDecodeMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
void SetName(const OUString &rName)
void InsertIMapObject(const IMapObject &rIMapObject)
ScriptType GetScriptType(SvKeyValueIterator *) const
static bool ParseAreaOptions(ImageMap *pImageMap, std::u16string_view rBaseURL, const HTMLOptions &rOptions, SvMacroItemId nEventMouseOver, SvMacroItemId nEventMouseOut)
const OUString & GetScriptTypeString(SvKeyValueIterator *) const
std::unique_ptr< SfxMedium > pDLMedium
void StartFileDownload(const OUString &rURL)
static double GetTableDataOptionsValNum(sal_uInt32 &nNumForm, LanguageType &eNumLang, const OUString &aValStr, std::u16string_view aNumStr, SvNumberFormatter &rFormatter)
SAL_DLLPRIVATE void GetScriptType_Impl(SvKeyValueIterator *)
virtual ~SfxHTMLParser() override
static bool ParseMapOptions(ImageMap *pImageMap, const HTMLOptions &rOptions)
bool FinishFileDownload(OUString &rStr)
SfxHTMLParser(SvStream &rStream, bool bNewDoc, SfxMedium *pMedium)
virtual bool GetFirst(SvKeyValue &rKeyVal)
virtual bool GetNext(SvKeyValue &rKeyVal)
const OUString & GetKey() const
const OUString & GetValue() const
virtual sal_uInt64 TellEnd() override
rtl_TextEncoding GetSrcEncoding() const
bool IsSwitchToUCS2() const
void SetSwitchToUCS2(bool bSet)
sal_uInt64 Seek(sal_uInt64 nPos)
SvStream & WriteStream(SvStream &rStream)
SvxMacro & Insert(SvMacroItemId nEvent, const SvxMacro &rMacro)
#define DBG_ASSERT(sCon, aError)
SvMacroItemId
these values get stored in streams in a 16-bit value
#define OOO_STRING_SVTOOLS_HTML_LG_javascript
#define OOO_STRING_SVTOOLS_HTML_SH_circle
#define OOO_STRING_SVTOOLS_HTML_SH_circ
#define OOO_STRING_SVTOOLS_HTML_SH_rect
#define OOO_STRING_SVTOOLS_HTML_META_content_script_type
#define OOO_STRING_SVTOOLS_HTML_LG_starbasic
#define OOO_STRING_SVTOOLS_HTML_SH_rectangle
#define OOO_STRING_SVTOOLS_HTML_SH_polygon
#define OOO_STRING_SVTOOLS_HTML_SH_poly
LineEnd GetSystemLineEnd()
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
constexpr OUStringLiteral SVX_MACRO_LANGUAGE_JAVASCRIPT
constexpr OUStringLiteral SVX_MACRO_LANGUAGE_STARBASIC
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
#define SFX_STREAM_READONLY
::std::vector< HTMLOption > HTMLOptions
HTMLOptionEnum< IMapObjectType > const aAreaShapeOptEnums[]
OUString read_uInt8s_ToOUString(SvStream &rStrm, std::size_t nUnits, rtl_TextEncoding eEnc)