]> git.saurik.com Git - wxWidgets.git/blob - src/richtext/richtexthtml.cpp
Make the wxComboCtrl's wxTextEntry interface more complete and consistent. All text...
[wxWidgets.git] / src / richtext / richtexthtml.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/richtext/richtexthtml.cpp
3 // Purpose: HTML I/O for wxRichTextCtrl
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 2005-09-30
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
14
15 #ifdef __BORLANDC__
16 #pragma hdrstop
17 #endif
18
19 #if wxUSE_RICHTEXT
20
21 #include "wx/richtext/richtexthtml.h"
22 #include "wx/richtext/richtextstyles.h"
23
24 #ifndef WX_PRECOMP
25 #endif
26
27 #include "wx/filename.h"
28 #include "wx/wfstream.h"
29 #include "wx/txtstrm.h"
30
31 #if wxUSE_FILESYSTEM
32 #include "wx/filesys.h"
33 #include "wx/fs_mem.h"
34 #endif
35
36 IMPLEMENT_DYNAMIC_CLASS(wxRichTextHTMLHandler, wxRichTextFileHandler)
37
38 int wxRichTextHTMLHandler::sm_fileCounter = 1;
39
40 wxRichTextHTMLHandler::wxRichTextHTMLHandler(const wxString& name, const wxString& ext, int type)
41 : wxRichTextFileHandler(name, ext, type), m_buffer(NULL), m_font(false), m_inTable(false)
42 {
43 m_fontSizeMapping.Add(8);
44 m_fontSizeMapping.Add(10);
45 m_fontSizeMapping.Add(13);
46 m_fontSizeMapping.Add(17);
47 m_fontSizeMapping.Add(22);
48 m_fontSizeMapping.Add(30);
49 m_fontSizeMapping.Add(100);
50 }
51
52 /// Can we handle this filename (if using files)? By default, checks the extension.
53 bool wxRichTextHTMLHandler::CanHandle(const wxString& filename) const
54 {
55 wxString path, file, ext;
56 wxFileName::SplitPath(filename, & path, & file, & ext);
57
58 return (ext.Lower() == wxT("html") || ext.Lower() == wxT("htm"));
59 }
60
61
62 #if wxUSE_STREAMS
63 bool wxRichTextHTMLHandler::DoLoadFile(wxRichTextBuffer *WXUNUSED(buffer), wxInputStream& WXUNUSED(stream))
64 {
65 return false;
66 }
67
68 /*
69 * We need to output only _changes_ in character formatting.
70 */
71
72 bool wxRichTextHTMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream)
73 {
74 m_buffer = buffer;
75
76 ClearTemporaryImageLocations();
77
78 buffer->Defragment();
79
80 #if wxUSE_UNICODE
81 wxCSConv* customEncoding = NULL;
82 wxMBConv* conv = NULL;
83 if (!GetEncoding().IsEmpty())
84 {
85 customEncoding = new wxCSConv(GetEncoding());
86 if (!customEncoding->IsOk())
87 {
88 wxDELETE(customEncoding);
89 }
90 }
91 if (customEncoding)
92 conv = customEncoding;
93 else
94 conv = & wxConvUTF8;
95 #endif
96
97 {
98 #if wxUSE_UNICODE
99 wxTextOutputStream str(stream, wxEOL_NATIVE, *conv);
100 #else
101 wxTextOutputStream str(stream, wxEOL_NATIVE);
102 #endif
103
104 wxRichTextAttr currentParaStyle = buffer->GetAttributes();
105 wxRichTextAttr currentCharStyle = buffer->GetAttributes();
106
107 if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0)
108 str << wxT("<html><head></head><body>\n");
109
110 OutputFont(currentParaStyle, str);
111
112 m_font = false;
113 m_inTable = false;
114
115 m_indents.Clear();
116 m_listTypes.Clear();
117
118 wxRichTextObjectList::compatibility_iterator node = buffer->GetChildren().GetFirst();
119 while (node)
120 {
121 wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph);
122 wxASSERT (para != NULL);
123
124 if (para)
125 {
126 wxRichTextAttr paraStyle(para->GetCombinedAttributes());
127
128 BeginParagraphFormatting(currentParaStyle, paraStyle, str);
129
130 wxRichTextObjectList::compatibility_iterator node2 = para->GetChildren().GetFirst();
131 while (node2)
132 {
133 wxRichTextObject* obj = node2->GetData();
134 wxRichTextPlainText* textObj = wxDynamicCast(obj, wxRichTextPlainText);
135 if (textObj && !textObj->IsEmpty())
136 {
137 wxRichTextAttr charStyle(para->GetCombinedAttributes(obj->GetAttributes()));
138 BeginCharacterFormatting(currentCharStyle, charStyle, paraStyle, str);
139
140 wxString text = textObj->GetText();
141
142 if (charStyle.HasTextEffects() && (charStyle.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
143 text.MakeUpper();
144
145 wxString toReplace = wxRichTextLineBreakChar;
146 text.Replace(toReplace, wxT("<br>"));
147
148 str << text;
149
150 EndCharacterFormatting(currentCharStyle, charStyle, paraStyle, str);
151 }
152
153 wxRichTextImage* image = wxDynamicCast(obj, wxRichTextImage);
154 if( image && (!image->IsEmpty() || image->GetImageBlock().GetData()))
155 WriteImage( image, stream );
156
157 node2 = node2->GetNext();
158 }
159
160 EndParagraphFormatting(currentParaStyle, paraStyle, str);
161
162 str << wxT("\n");
163 }
164 node = node->GetNext();
165 }
166
167 CloseLists(-1, str);
168
169 str << wxT("</font>");
170
171 if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0)
172 str << wxT("</body></html>");
173
174 str << wxT("\n");
175 }
176
177 #if wxUSE_UNICODE
178 if (customEncoding)
179 delete customEncoding;
180 #endif
181
182 m_buffer = NULL;
183
184 return true;
185 }
186
187 void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxRichTextAttr& currentStyle, const wxRichTextAttr& thisStyle, const wxRichTextAttr& WXUNUSED(paraStyle), wxTextOutputStream& str)
188 {
189 wxString style;
190
191 // Is there any change in the font properties of the item?
192 if (thisStyle.GetFontFaceName() != currentStyle.GetFontFaceName())
193 {
194 wxString faceName(thisStyle.GetFontFaceName());
195 style += wxString::Format(wxT(" face=\"%s\""), faceName.c_str());
196 }
197 if (thisStyle.GetFontSize() != currentStyle.GetFontSize())
198 style += wxString::Format(wxT(" size=\"%ld\""), PtToSize(thisStyle.GetFontSize()));
199 if (thisStyle.GetTextColour() != currentStyle.GetTextColour() )
200 {
201 wxString color(thisStyle.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX));
202 style += wxString::Format(wxT(" color=\"%s\""), color.c_str());
203 }
204
205 if (style.size())
206 {
207 str << wxString::Format(wxT("<font %s >"), style.c_str());
208 m_font = true;
209 }
210
211 if (thisStyle.GetFontWeight() == wxBOLD)
212 str << wxT("<b>");
213 if (thisStyle.GetFontStyle() == wxITALIC)
214 str << wxT("<i>");
215 if (thisStyle.GetFontUnderlined())
216 str << wxT("<u>");
217
218 if (thisStyle.HasURL())
219 str << wxT("<a href=\"") << thisStyle.GetURL() << wxT("\">");
220 }
221
222 void wxRichTextHTMLHandler::EndCharacterFormatting(const wxRichTextAttr& WXUNUSED(currentStyle), const wxRichTextAttr& thisStyle, const wxRichTextAttr& WXUNUSED(paraStyle), wxTextOutputStream& stream)
223 {
224 if (thisStyle.HasURL())
225 stream << wxT("</a>");
226
227 if (thisStyle.GetFontUnderlined())
228 stream << wxT("</u>");
229 if (thisStyle.GetFontStyle() == wxITALIC)
230 stream << wxT("</i>");
231 if (thisStyle.GetFontWeight() == wxBOLD)
232 stream << wxT("</b>");
233
234 if (m_font)
235 {
236 m_font = false;
237 stream << wxT("</font>");
238 }
239 }
240
241 /// Begin paragraph formatting
242 void wxRichTextHTMLHandler::BeginParagraphFormatting(const wxRichTextAttr& WXUNUSED(currentStyle), const wxRichTextAttr& thisStyle, wxTextOutputStream& str)
243 {
244 if (thisStyle.HasPageBreak())
245 {
246 str << wxT("<div style=\"page-break-after:always\"></div>\n");
247 }
248
249 if (thisStyle.HasLeftIndent() && thisStyle.GetLeftIndent() != 0)
250 {
251 if (thisStyle.HasBulletStyle())
252 {
253 int indent = thisStyle.GetLeftIndent();
254
255 // Close levels high than this
256 CloseLists(indent, str);
257
258 if (m_indents.GetCount() > 0 && indent == m_indents.Last())
259 {
260 // Same level, no need to start a new list
261 }
262 else if (m_indents.GetCount() == 0 || indent > m_indents.Last())
263 {
264 m_indents.Add(indent);
265
266 wxString tag;
267 int listType = TypeOfList(thisStyle, tag);
268 m_listTypes.Add(listType);
269
270 // wxHTML needs an extra <p> before a list when using <p> ... </p> in previous paragraphs.
271 // TODO: pass a flag that indicates we're using wxHTML.
272 str << wxT("<p>\n");
273
274 str << tag;
275 }
276
277 str << wxT("<li> ");
278 }
279 else
280 {
281 CloseLists(-1, str);
282
283 wxString align = GetAlignment(thisStyle);
284 str << wxString::Format(wxT("<p align=\"%s\""), align.c_str());
285
286 wxString styleStr;
287
288 if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) && thisStyle.HasParagraphSpacingBefore())
289 {
290 float spacingBeforeMM = thisStyle.GetParagraphSpacingBefore() / 10.0;
291
292 styleStr += wxString::Format(wxT("margin-top: %.2fmm; "), spacingBeforeMM);
293 }
294 if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) && thisStyle.HasParagraphSpacingAfter())
295 {
296 float spacingAfterMM = thisStyle.GetParagraphSpacingAfter() / 10.0;
297
298 styleStr += wxString::Format(wxT("margin-bottom: %.2fmm; "), spacingAfterMM);
299 }
300
301 float indentLeftMM = (thisStyle.GetLeftIndent() + thisStyle.GetLeftSubIndent())/10.0;
302 if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) && (indentLeftMM > 0.0))
303 {
304 styleStr += wxString::Format(wxT("margin-left: %.2fmm; "), indentLeftMM);
305 }
306 float indentRightMM = thisStyle.GetRightIndent()/10.0;
307 if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) && thisStyle.HasRightIndent() && (indentRightMM > 0.0))
308 {
309 styleStr += wxString::Format(wxT("margin-right: %.2fmm; "), indentRightMM);
310 }
311 // First line indentation
312 float firstLineIndentMM = - thisStyle.GetLeftSubIndent() / 10.0;
313 if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) && (firstLineIndentMM > 0.0))
314 {
315 styleStr += wxString::Format(wxT("text-indent: %.2fmm; "), firstLineIndentMM);
316 }
317
318 if (!styleStr.IsEmpty())
319 str << wxT(" style=\"") << styleStr << wxT("\"");
320
321 str << wxT(">");
322
323 // TODO: convert to pixels
324 int indentPixels = static_cast<int>(indentLeftMM*10/4);
325
326 if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) == 0)
327 {
328 // Use a table to do indenting if we don't have CSS
329 str << wxString::Format(wxT("<table border=0 cellpadding=0 cellspacing=0><tr><td width=\"%d\"></td><td>"), indentPixels);
330 m_inTable = true;
331 }
332
333 if (((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) == 0) && (thisStyle.GetLeftSubIndent() < 0))
334 {
335 str << SymbolicIndent( - thisStyle.GetLeftSubIndent());
336 }
337 }
338 }
339 else
340 {
341 CloseLists(-1, str);
342
343 wxString align = GetAlignment(thisStyle);
344 str << wxString::Format(wxT("<p align=\"%s\""), align.c_str());
345
346 wxString styleStr;
347
348 if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) && thisStyle.HasParagraphSpacingBefore())
349 {
350 float spacingBeforeMM = thisStyle.GetParagraphSpacingBefore() / 10.0;
351
352 styleStr += wxString::Format(wxT("margin-top: %.2fmm; "), spacingBeforeMM);
353 }
354 if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) && thisStyle.HasParagraphSpacingAfter())
355 {
356 float spacingAfterMM = thisStyle.GetParagraphSpacingAfter() / 10.0;
357
358 styleStr += wxString::Format(wxT("margin-bottom: %.2fmm; "), spacingAfterMM);
359 }
360
361 if (!styleStr.IsEmpty())
362 str << wxT(" style=\"") << styleStr << wxT("\"");
363
364 str << wxT(">");
365 }
366 OutputFont(thisStyle, str);
367 }
368
369 /// End paragraph formatting
370 void wxRichTextHTMLHandler::EndParagraphFormatting(const wxRichTextAttr& WXUNUSED(currentStyle), const wxRichTextAttr& thisStyle, wxTextOutputStream& stream)
371 {
372 if (thisStyle.HasFont())
373 stream << wxT("</font>");
374
375 if (m_inTable)
376 {
377 stream << wxT("</td></tr></table></p>\n");
378 m_inTable = false;
379 }
380 else if (!thisStyle.HasBulletStyle())
381 stream << wxT("</p>\n");
382 }
383
384 /// Closes lists to level (-1 means close all)
385 void wxRichTextHTMLHandler::CloseLists(int level, wxTextOutputStream& str)
386 {
387 // Close levels high than this
388 int i = m_indents.GetCount()-1;
389 while (i >= 0)
390 {
391 int l = m_indents[i];
392 if (l > level)
393 {
394 if (m_listTypes[i] == 0)
395 str << wxT("</ol>");
396 else
397 str << wxT("</ul>");
398 m_indents.RemoveAt(i);
399 m_listTypes.RemoveAt(i);
400 }
401 else
402 break;
403 i --;
404 }
405 }
406
407 /// Output font tag
408 void wxRichTextHTMLHandler::OutputFont(const wxRichTextAttr& style, wxTextOutputStream& stream)
409 {
410 if (style.HasFont())
411 {
412 stream << wxString::Format(wxT("<font face=\"%s\" size=\"%ld\""), style.GetFontFaceName().c_str(), PtToSize(style.GetFontSize()));
413 if (style.HasTextColour())
414 stream << wxString::Format(wxT(" color=\"%s\""), style.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX).c_str());
415 stream << wxT(" >");
416 }
417 }
418
419 int wxRichTextHTMLHandler::TypeOfList( const wxRichTextAttr& thisStyle, wxString& tag )
420 {
421 // We can use number attribute of li tag but not all the browsers support it.
422 // also wxHtmlWindow doesn't support type attribute.
423
424 bool m_is_ul = false;
425 if (thisStyle.GetBulletStyle() == (wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD))
426 tag = wxT("<ol type=\"1\">");
427 else if (thisStyle.GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER)
428 tag = wxT("<ol type=\"A\">");
429 else if (thisStyle.GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER)
430 tag = wxT("<ol type=\"a\">");
431 else if (thisStyle.GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER)
432 tag = wxT("<ol type=\"I\">");
433 else if (thisStyle.GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER)
434 tag = wxT("<ol type=\"i\">");
435 else
436 {
437 tag = wxT("<ul>");
438 m_is_ul = true;
439 }
440
441 if (m_is_ul)
442 return 1;
443 else
444 return 0;
445 }
446
447 wxString wxRichTextHTMLHandler::GetAlignment( const wxRichTextAttr& thisStyle )
448 {
449 switch( thisStyle.GetAlignment() )
450 {
451 case wxTEXT_ALIGNMENT_LEFT:
452 return wxT("left");
453 case wxTEXT_ALIGNMENT_RIGHT:
454 return wxT("right");
455 case wxTEXT_ALIGNMENT_CENTER:
456 return wxT("center");
457 case wxTEXT_ALIGNMENT_JUSTIFIED:
458 return wxT("justify");
459 default:
460 return wxT("left");
461 }
462 }
463
464 void wxRichTextHTMLHandler::WriteImage(wxRichTextImage* image, wxOutputStream& stream)
465 {
466 wxTextOutputStream str(stream);
467
468 str << wxT("<img src=\"");
469
470 #if wxUSE_FILESYSTEM
471 if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY)
472 {
473 #if 0
474 if (!image->GetImage().Ok() && image->GetImageBlock().GetData())
475 image->LoadFromBlock();
476 if (image->GetImage().Ok() && !image->GetImageBlock().GetData())
477 image->MakeBlock();
478 #endif
479
480 if (image->GetImageBlock().IsOk())
481 {
482 wxImage img;
483 image->GetImageBlock().Load(img);
484 if (img.IsOk())
485 {
486 wxString ext(image->GetImageBlock().GetExtension());
487 wxString tempFilename(wxString::Format(wxT("image%d.%s"), sm_fileCounter, ext));
488 wxMemoryFSHandler::AddFile(tempFilename, img, image->GetImageBlock().GetImageType());
489
490 m_imageLocations.Add(tempFilename);
491
492 str << wxT("memory:") << tempFilename;
493 }
494 }
495 else
496 str << wxT("memory:?");
497
498 sm_fileCounter ++;
499 }
500 else if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES)
501 {
502 #if 0
503 if (!image->GetImage().Ok() && image->GetImageBlock().GetData())
504 image->LoadFromBlock();
505 if (image->GetImage().Ok() && !image->GetImageBlock().GetData())
506 image->MakeBlock();
507 #endif
508
509 if (image->GetImageBlock().Ok())
510 {
511 wxString tempDir(GetTempDir());
512 if (tempDir.IsEmpty())
513 tempDir = wxFileName::GetTempDir();
514
515 wxString ext(image->GetImageBlock().GetExtension());
516 wxString tempFilename(wxString::Format(wxT("%s/image%d.%s"), tempDir, sm_fileCounter, ext));
517 image->GetImageBlock().Write(tempFilename);
518
519 m_imageLocations.Add(tempFilename);
520
521 str << wxFileSystem::FileNameToURL(tempFilename);
522 }
523 else
524 str << wxT("file:?");
525
526 sm_fileCounter ++;
527 }
528 else // if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_BASE64) // this is implied
529 #endif
530 {
531 str << wxT("data:");
532 str << GetMimeType(image->GetImageBlock().GetImageType());
533 str << wxT(";base64,");
534 #if 0
535 if (image->GetImage().Ok() && !image->GetImageBlock().GetData())
536 image->MakeBlock();
537 #endif
538 if (image->GetImageBlock().Ok())
539 {
540 wxChar* data = b64enc( image->GetImageBlock().GetData(), image->GetImageBlock().GetDataSize() );
541 str << data;
542
543 delete[] data;
544 }
545 }
546
547 str << wxT("\" />");
548 }
549
550 long wxRichTextHTMLHandler::PtToSize(long size)
551 {
552 int i;
553 int len = m_fontSizeMapping.GetCount();
554 for (i = 0; i < len; i++)
555 if (size <= m_fontSizeMapping[i])
556 return i+1;
557 return 7;
558 }
559
560 wxString wxRichTextHTMLHandler::SymbolicIndent(long indent)
561 {
562 wxString in;
563 for(;indent > 0; indent -= 20)
564 in.Append( wxT("&nbsp;") );
565 return in;
566 }
567
568 const wxChar* wxRichTextHTMLHandler::GetMimeType(int imageType)
569 {
570 switch(imageType)
571 {
572 case wxBITMAP_TYPE_BMP:
573 return wxT("image/bmp");
574 case wxBITMAP_TYPE_TIF:
575 return wxT("image/tiff");
576 case wxBITMAP_TYPE_GIF:
577 return wxT("image/gif");
578 case wxBITMAP_TYPE_PNG:
579 return wxT("image/png");
580 case wxBITMAP_TYPE_JPEG:
581 return wxT("image/jpeg");
582 default:
583 return wxT("image/unknown");
584 }
585 }
586
587 // exim-style base64 encoder
588 wxChar* wxRichTextHTMLHandler::b64enc( unsigned char* input, size_t in_len )
589 {
590 // elements of enc64 array must be 8 bit values
591 // otherwise encoder will fail
592 // hmmm.. Does wxT macro define a char as 16 bit value
593 // when compiling with UNICODE option?
594 static const wxChar enc64[] = wxT("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
595 wxChar* output = new wxChar[4*((in_len+2)/3)+1];
596 wxChar* p = output;
597
598 while( in_len-- > 0 )
599 {
600 register wxChar a, b;
601
602 a = *input++;
603
604 *p++ = enc64[ (a >> 2) & 0x3f ];
605
606 if( in_len-- == 0 )
607 {
608 *p++ = enc64[ (a << 4 ) & 0x30 ];
609 *p++ = '=';
610 *p++ = '=';
611 break;
612 }
613
614 b = *input++;
615
616 *p++ = enc64[(( a << 4 ) | ((b >> 4) &0xf )) & 0x3f];
617
618 if( in_len-- == 0 )
619 {
620 *p++ = enc64[ (b << 2) & 0x3f ];
621 *p++ = '=';
622 break;
623 }
624
625 a = *input++;
626
627 *p++ = enc64[ ((( b << 2 ) & 0x3f ) | ((a >> 6)& 0x3)) & 0x3f ];
628
629 *p++ = enc64[ a & 0x3f ];
630 }
631 *p = 0;
632
633 return output;
634 }
635 #endif
636 // wxUSE_STREAMS
637
638 /// Delete the in-memory or temporary files generated by the last operation
639 bool wxRichTextHTMLHandler::DeleteTemporaryImages()
640 {
641 return DeleteTemporaryImages(GetFlags(), m_imageLocations);
642 }
643
644 /// Delete the in-memory or temporary files generated by the last operation
645 bool wxRichTextHTMLHandler::DeleteTemporaryImages(int flags, const wxArrayString& imageLocations)
646 {
647 size_t i;
648 for (i = 0; i < imageLocations.GetCount(); i++)
649 {
650 wxString location = imageLocations[i];
651
652 if (flags & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY)
653 {
654 #if wxUSE_FILESYSTEM
655 wxMemoryFSHandler::RemoveFile(location);
656 #endif
657 }
658 else if (flags & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES)
659 {
660 if (wxFileExists(location))
661 wxRemoveFile(location);
662 }
663 }
664
665 return true;
666 }
667
668
669 #endif
670 // wxUSE_RICHTEXT
671