diff --git a/kcal/htmlexport.cpp b/kcal/htmlexport.cpp
index 9d09d20df..db7f1fe79 100644
--- a/kcal/htmlexport.cpp
+++ b/kcal/htmlexport.cpp
@@ -1,782 +1,781 @@
/*
This file is part of the kcal library.
Copyright (c) 2000,2001 Cornelius Schumacher
Copyright (C) 2004 Reinhold Kainhofer
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "htmlexport.h"
#include "htmlexportsettings.h"
#include "incidenceformatter.h"
#include "calendar.h"
#include "event.h"
#include "todo.h"
#ifndef KORG_NOKABC
#include "kabc/stdaddressbook.h"
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace KCal;
static QString cleanChars( const QString &txt );
//@cond PRIVATE
class KCal::HtmlExport::Private
{
public:
Private( Calendar *calendar, HTMLExportSettings *settings )
: mCalendar( calendar ),
mSettings( settings )
{}
Calendar *mCalendar;
HTMLExportSettings *mSettings;
QMap mHolidayMap;
};
//@endcond
HtmlExport::HtmlExport( Calendar *calendar, HTMLExportSettings *settings )
: d( new Private( calendar, settings ) )
{
}
HtmlExport::~HtmlExport()
{
delete d;
}
bool HtmlExport::save( const QString &fileName )
{
QString fn( fileName );
if ( fn.isEmpty() && d->mSettings ) {
fn = d->mSettings->outputFile();
}
if ( !d->mSettings || fn.isEmpty() ) {
return false;
}
QFile f( fileName );
if ( !f.open( QIODevice::WriteOnly ) ) {
return false;
}
QTextStream ts( &f );
bool success = save( &ts );
f.close();
return success;
}
bool HtmlExport::save( QTextStream *ts )
{
if ( !d->mSettings ) {
return false;
}
ts->setCodec( "UTF-8" );
-
// Write HTML header
*ts << "\n";
+ *ts << "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"<" << endl;
*ts << " \n";
+ *ts << "UTF-8\" />"<mSettings->pageTitle().isEmpty() ) {
- *ts << " " << d->mSettings->pageTitle() << "\n";
+ *ts << " " << d->mSettings->pageTitle() << ""<\n";
+ *ts << " \n";
- *ts << "\n";
+ *ts << " "<"<mSettings->eventView() || d->mSettings->monthView() || d->mSettings->weekView() ) {
if ( !d->mSettings->eventTitle().isEmpty() ) {
- *ts << "" << d->mSettings->eventTitle() << "
\n";
+ *ts << "" << d->mSettings->eventTitle() << "
"<mSettings->weekView() ) {
createWeekView( ts );
}
// Write Month View
if ( d->mSettings->monthView() ) {
createMonthView( ts );
}
// Write Event List
if ( d->mSettings->eventView() ) {
createEventList( ts );
}
}
// Write Todo List
if ( d->mSettings->todoView() ) {
if ( !d->mSettings->todoListTitle().isEmpty() ) {
- *ts << "" << d->mSettings->todoListTitle() << "
\n";
+ *ts << "" << d->mSettings->todoListTitle() << "
"<mSettings->journalView() ) {
if ( !d->mSettings->journalTitle().isEmpty() ) {
- *ts << "" << d->mSettings->journalTitle() << "
\n";
+ *ts << "" << d->mSettings->journalTitle() << "
"<mSettings->freeBusyView() ) {
if ( !d->mSettings->freeBusyTitle().isEmpty() ) {
- *ts << "" << d->mSettings->freeBusyTitle() << "
\n";
+ *ts << "" << d->mSettings->freeBusyTitle() << "
"<\n";
+ *ts << "