LCOV - code coverage report
Current view: top level - libreoffice/dbaccess/source/ui/misc - HtmlReader.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 251 0.0 %
Date: 2012-12-27 Functions: 0 14 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : #include "HtmlReader.hxx"
      21             : #include <connectivity/dbconversion.hxx>
      22             : #include <connectivity/dbtools.hxx>
      23             : #include <tools/tenccvt.hxx>
      24             : #include <comphelper/extract.hxx>
      25             : #include <comphelper/string.hxx>
      26             : #include "dbu_misc.hrc"
      27             : #include "dbustrings.hrc"
      28             : #include <sfx2/sfxhtml.hxx>
      29             : #include <osl/diagnose.h>
      30             : #include "moduledbu.hxx"
      31             : #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
      32             : #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
      33             : #include <com/sun/star/sdbcx/XAppend.hpp>
      34             : #include <com/sun/star/sdbc/DataType.hpp>
      35             : #include <com/sun/star/sdbc/ColumnValue.hpp>
      36             : #include <com/sun/star/awt/FontDescriptor.hpp>
      37             : #include <com/sun/star/awt/FontWeight.hpp>
      38             : #include <com/sun/star/awt/FontStrikeout.hpp>
      39             : #include <com/sun/star/awt/FontSlant.hpp>
      40             : #include <com/sun/star/awt/FontUnderline.hpp>
      41             : #include <com/sun/star/util/NumberFormat.hpp>
      42             : #include <com/sun/star/util/XNumberFormatTypes.hpp>
      43             : #include <svtools/htmltokn.h>
      44             : #include <svtools/htmlkywd.hxx>
      45             : #include <tools/color.hxx>
      46             : #include "WCopyTable.hxx"
      47             : #include "WExtendPages.hxx"
      48             : #include "WNameMatch.hxx"
      49             : #include "WColumnSelect.hxx"
      50             : #include "QEnumTypes.hxx"
      51             : #include "WCPage.hxx"
      52             : #include <tools/inetmime.hxx>
      53             : #include <svl/inettype.hxx>
      54             : #include <rtl/tencinfo.h>
      55             : #include "UITools.hxx"
      56             : #include <vcl/svapp.hxx>
      57             : #include <rtl/logfile.hxx>
      58             : 
      59             : using namespace dbaui;
      60             : using namespace ::com::sun::star::uno;
      61             : using namespace ::com::sun::star::beans;
      62             : using namespace ::com::sun::star::container;
      63             : using namespace ::com::sun::star::sdbc;
      64             : using namespace ::com::sun::star::sdbcx;
      65             : using namespace ::com::sun::star::awt;
      66             : 
      67             : #define DBAUI_HTML_FONTSIZES    8       // like export, HTML-Options
      68             : #define HTML_META_NONE          0
      69             : #define HTML_META_AUTHOR        1
      70             : #define HTML_META_DESCRIPTION   2
      71             : #define HTML_META_KEYWORDS      3
      72             : #define HTML_META_REFRESH       4
      73             : #define HTML_META_CLASSIFICATION 5
      74             : #define HTML_META_CREATED       6
      75             : #define HTML_META_CHANGEDBY     7
      76             : #define HTML_META_CHANGED       8
      77             : #define HTML_META_GENERATOR     9
      78             : #define HTML_META_SDFOOTNOTE    10
      79             : #define HTML_META_SDENDNOTE     11
      80             : #define HTML_META_CONTENT_TYPE  12
      81             : 
      82             : // ==========================================================================
      83             : DBG_NAME(OHTMLReader)
      84             : // ==========================================================================
      85             : // OHTMLReader
      86             : // ==========================================================================
      87           0 : OHTMLReader::OHTMLReader(SvStream& rIn,const SharedConnection& _rxConnection,
      88             :                         const Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF,
      89             :                         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
      90             :                         const TColumnVector* pList,
      91             :                         const OTypeInfoMap* _pInfoMap)
      92             :     :HTMLParser(rIn)
      93             :     ,ODatabaseExport( _rxConnection, _rxNumberF, _rxContext, pList, _pInfoMap, rIn )
      94             :     ,m_nTableCount(0)
      95             :     ,m_nColumnWidth(87)
      96             :     ,m_bMetaOptions(sal_False)
      97           0 :     ,m_bSDNum(sal_False)
      98             : {
      99             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::OHTMLReader" );
     100             :     DBG_CTOR(OHTMLReader,NULL);
     101           0 :     SetSrcEncoding( GetExtendedCompatibilityTextEncoding(  RTL_TEXTENCODING_ISO_8859_1 ) );
     102             :     // If the file starts with a BOM, switch to UCS2.
     103           0 :     SetSwitchToUCS2( sal_True );
     104           0 : }
     105             : // ---------------------------------------------------------------------------
     106           0 : OHTMLReader::OHTMLReader(SvStream& rIn,
     107             :                          sal_Int32 nRows,
     108             :                          const TPositions &_rColumnPositions,
     109             :                          const Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF,
     110             :                          const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
     111             :                          const TColumnVector* pList,
     112             :                          const OTypeInfoMap* _pInfoMap,
     113             :                          sal_Bool _bAutoIncrementEnabled)
     114             :     :HTMLParser(rIn)
     115             :     ,ODatabaseExport( nRows, _rColumnPositions, _rxNumberF, _rxContext, pList, _pInfoMap, _bAutoIncrementEnabled, rIn )
     116             :     ,m_nTableCount(0)
     117             :     ,m_nColumnWidth(87)
     118             :     ,m_bMetaOptions(sal_False)
     119           0 :     ,m_bSDNum(sal_False)
     120             : {
     121             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::OHTMLReader" );
     122             :     DBG_CTOR(OHTMLReader,NULL);
     123           0 :     SetSrcEncoding( GetExtendedCompatibilityTextEncoding(  RTL_TEXTENCODING_ISO_8859_1 ) );
     124             :     // If the file starts with a BOM, switch to UCS2.
     125           0 :     SetSwitchToUCS2( sal_True );
     126           0 : }
     127             : // ---------------------------------------------------------------------------
     128           0 : OHTMLReader::~OHTMLReader()
     129             : {
     130             :     DBG_DTOR(OHTMLReader,NULL);
     131           0 : }
     132             : // ---------------------------------------------------------------------------
     133           0 : SvParserState OHTMLReader::CallParser()
     134             : {
     135             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::CallParser" );
     136             :     DBG_CHKTHIS(OHTMLReader,NULL);
     137           0 :     rInput.Seek(STREAM_SEEK_TO_BEGIN);
     138           0 :     rInput.ResetError();
     139           0 :     SvParserState  eParseState = HTMLParser::CallParser();
     140           0 :     SetColumnTypes(m_pColumnList,m_pInfoMap);
     141           0 :     return m_bFoundTable ? eParseState : SVPAR_ERROR;
     142             : }
     143             : // -----------------------------------------------------------------------------
     144           0 : void OHTMLReader::NextToken( int nToken )
     145             : {
     146             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::NextToken" );
     147             :     DBG_CHKTHIS(OHTMLReader,NULL);
     148           0 :     if(m_bError || !m_nRows) // if there is an error or no more rows to check, return immediatelly
     149           0 :         return;
     150           0 :     if ( nToken ==  HTML_META )
     151           0 :         setTextEncoding();
     152             : 
     153           0 :     if(m_xConnection.is())    // names, which CTOR was called and hence, if a table should be created
     154             :     {
     155           0 :         switch(nToken)
     156             :         {
     157             :             case HTML_TABLE_ON:
     158           0 :                 ++m_nTableCount;
     159             :                 {   // can also be TD or TH, if there was no TABLE before
     160           0 :                     const HTMLOptions& rHtmlOptions = GetOptions();
     161           0 :                     for (size_t i = 0, n = rHtmlOptions.size(); i < n; ++i)
     162             :                     {
     163           0 :                         const HTMLOption& rOption = rHtmlOptions[i];
     164           0 :                         switch( rOption.GetToken() )
     165             :                         {
     166             :                             case HTML_O_WIDTH:
     167             :                             {   // percentage: of document width respectively outer cell
     168           0 :                                 m_nColumnWidth = GetWidthPixel( rOption );
     169             :                             }
     170           0 :                             break;
     171             :                         }
     172             :                     }
     173             :                 }
     174             :             case HTML_THEAD_ON:
     175             :             case HTML_TBODY_ON:
     176             :                 {
     177           0 :                     sal_uInt32 nTell = rInput.Tell(); // perhaps alters position of the stream
     178           0 :                     if ( !m_xTable.is() )
     179             :                     {// use first line as header
     180           0 :                         m_bError = !CreateTable(nToken);
     181           0 :                         if ( m_bAppendFirstLine )
     182           0 :                             rInput.Seek(nTell);
     183             :                     }
     184             :                 }
     185           0 :                 break;
     186             :             case HTML_TABLE_OFF:
     187           0 :                 if(!--m_nTableCount)
     188             :                 {
     189           0 :                     m_xTable = NULL;
     190             :                 }
     191           0 :                 break;
     192             :             case HTML_TABLEROW_ON:
     193           0 :                 if ( m_pUpdateHelper.get() )
     194             :                 {
     195             :                     try
     196             :                     {
     197           0 :                         m_pUpdateHelper->moveToInsertRow(); // otherwise append new line
     198             :                     }
     199           0 :                     catch(SQLException& e)
     200             :                     // handling update failure
     201             :                     {
     202           0 :                         showErrorDialog(e);
     203             :                     }
     204             :                 }
     205             :                 else
     206           0 :                     m_bError = sal_True;
     207           0 :                 break;
     208             :             case HTML_TEXTTOKEN:
     209             :             case HTML_SINGLECHAR:
     210           0 :                 if ( m_bInTbl ) //&& !m_bSDNum ) // important, as otherwise we also get the names of the fonts
     211           0 :                     m_sTextToken += aToken;
     212           0 :                 break;
     213             :             case HTML_PARABREAK_OFF:
     214           0 :                 m_sCurrent += m_sTextToken;
     215           0 :                 break;
     216             :             case HTML_PARABREAK_ON:
     217           0 :                 m_sTextToken.Erase();
     218           0 :                 break;
     219             :             case HTML_TABLEDATA_ON:
     220           0 :                 fetchOptions();
     221           0 :                 break;
     222             :             case HTML_TABLEDATA_OFF:
     223             :                 {
     224           0 :                     if ( m_sCurrent.Len() )
     225           0 :                         m_sTextToken = m_sCurrent;
     226             :                     try
     227             :                     {
     228           0 :                         insertValueIntoColumn();
     229             :                     }
     230           0 :                     catch(SQLException& e)
     231             :                     // handling update failure
     232             :                     {
     233           0 :                         showErrorDialog(e);
     234             :                     }
     235           0 :                     m_sCurrent.Erase();
     236           0 :                     m_nColumnPos++;
     237           0 :                     eraseTokens();
     238           0 :                     m_bSDNum = m_bInTbl = sal_False;
     239             :                 }
     240           0 :                 break;
     241             :             case HTML_TABLEROW_OFF:
     242           0 :                 if ( !m_pUpdateHelper.get() )
     243             :                 {
     244           0 :                     m_bError = sal_True;
     245           0 :                     break;
     246             :                 }
     247             :                 try
     248             :                 {
     249           0 :                     m_nRowCount++;
     250           0 :                     if (m_bIsAutoIncrement) // if bSetAutoIncrement then I have to set the autoincrement
     251           0 :                         m_pUpdateHelper->updateInt(1,m_nRowCount);
     252           0 :                     m_pUpdateHelper->insertRow();
     253             :                 }
     254           0 :                 catch(SQLException& e)
     255             :                 //////////////////////////////////////////////////////////////////////
     256             :                 // handling update failure
     257             :                 {
     258           0 :                     showErrorDialog(e);
     259             :                 }
     260           0 :                 m_nColumnPos = 0;
     261           0 :                 break;
     262             :         }
     263             :     }
     264             :     else // branch only valid for type checking
     265             :     {
     266           0 :         switch(nToken)
     267             :         {
     268             :             case HTML_THEAD_ON:
     269             :             case HTML_TBODY_ON:
     270             :                 // The head of the column is not included
     271           0 :                 if(m_bHead)
     272             :                 {
     273           0 :                     do
     274             :                     {}
     275           0 :                     while(GetNextToken() != HTML_TABLEROW_OFF);
     276           0 :                     m_bHead = sal_False;
     277             :                 }
     278           0 :                 break;
     279             :             case HTML_TABLEDATA_ON:
     280             :             case HTML_TABLEHEADER_ON:
     281           0 :                 fetchOptions();
     282           0 :                 break;
     283             :             case HTML_TEXTTOKEN:
     284             :             case HTML_SINGLECHAR:
     285           0 :                 if ( m_bInTbl ) // && !m_bSDNum ) // important, as otherwise we also get the names of the fonts
     286           0 :                     m_sTextToken += aToken;
     287           0 :                 break;
     288             :             case HTML_PARABREAK_OFF:
     289           0 :                 m_sCurrent += m_sTextToken;
     290           0 :                 break;
     291             :             case HTML_PARABREAK_ON:
     292           0 :                 m_sTextToken.Erase();
     293           0 :                 break;
     294             :             case HTML_TABLEDATA_OFF:
     295           0 :                 if ( m_sCurrent.Len() )
     296           0 :                     m_sTextToken = m_sCurrent;
     297           0 :                 adjustFormat();
     298           0 :                 m_nColumnPos++;
     299           0 :                 m_bSDNum = m_bInTbl = sal_False;
     300           0 :                 m_sCurrent.Erase();
     301           0 :                 break;
     302             :             case HTML_TABLEROW_OFF:
     303           0 :                 if ( m_sCurrent.Len() )
     304           0 :                     m_sTextToken = m_sCurrent;
     305           0 :                 adjustFormat();
     306           0 :                 m_nColumnPos = 0;
     307           0 :                 m_nRows--;
     308           0 :                 m_sCurrent.Erase();
     309           0 :                 break;
     310             :         }
     311             :     }
     312             : }
     313             : // -----------------------------------------------------------------------------
     314           0 : void OHTMLReader::fetchOptions()
     315             : {
     316             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::fetchOptions" );
     317           0 :     m_bInTbl = sal_True;
     318           0 :     const HTMLOptions& options = GetOptions();
     319           0 :     for (size_t i = 0, n = options.size(); i < n; ++i)
     320             :     {
     321           0 :         const HTMLOption& rOption = options[i];
     322           0 :         switch( rOption.GetToken() )
     323             :         {
     324             :             case HTML_O_SDVAL:
     325             :             {
     326           0 :                 m_sValToken = rOption.GetString();
     327           0 :                 m_bSDNum = sal_True;
     328             :             }
     329           0 :             break;
     330             :             case HTML_O_SDNUM:
     331           0 :                 m_sNumToken = rOption.GetString();
     332           0 :             break;
     333             :         }
     334             :     }
     335           0 : }
     336             : //---------------------------------------------------------------------------------
     337           0 : void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal)
     338             : {
     339             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::TableDataOn" );
     340             :     DBG_CHKTHIS(OHTMLReader,NULL);
     341           0 :     const HTMLOptions& rHtmlOptions = GetOptions();
     342           0 :     for (size_t i = 0, n = rHtmlOptions.size(); i < n; ++i)
     343             :     {
     344           0 :         const HTMLOption& rOption = rHtmlOptions[i];
     345           0 :         switch( rOption.GetToken() )
     346             :         {
     347             :             case HTML_O_ALIGN:
     348             :             {
     349           0 :                 const String& rOptVal = rOption.GetString();
     350           0 :                 if (rOptVal.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_AL_right ))
     351           0 :                     eVal = SVX_HOR_JUSTIFY_RIGHT;
     352           0 :                 else if (rOptVal.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_AL_center ))
     353           0 :                     eVal = SVX_HOR_JUSTIFY_CENTER;
     354           0 :                 else if (rOptVal.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_AL_left ))
     355           0 :                     eVal = SVX_HOR_JUSTIFY_LEFT;
     356             :                 else
     357           0 :                     eVal = SVX_HOR_JUSTIFY_STANDARD;
     358             :             }
     359           0 :             break;
     360             :             case HTML_O_WIDTH:
     361           0 :                 m_nWidth = GetWidthPixel( rOption );
     362           0 :             break;
     363             :         }
     364             :     }
     365           0 : }
     366             : 
     367             : //---------------------------------------------------------------------------------
     368           0 : void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor)
     369             : {
     370             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::TableFontOn" );
     371             :     DBG_CHKTHIS(OHTMLReader,NULL);
     372           0 :     const HTMLOptions& rHtmlOptions = GetOptions();
     373           0 :     for (size_t i = 0, n = rHtmlOptions.size(); i < n; ++i)
     374             :     {
     375           0 :         const HTMLOption& rOption = rHtmlOptions[i];
     376           0 :         switch( rOption.GetToken() )
     377             :         {
     378             :         case HTML_O_COLOR:
     379             :             {
     380           0 :                 Color aColor;
     381           0 :                 rOption.GetColor( aColor );
     382           0 :                 _rTextColor = aColor.GetRGBColor();
     383             :             }
     384           0 :             break;
     385             :         case HTML_O_FACE :
     386             :             {
     387           0 :                 const String& rFace = rOption.GetString();
     388           0 :                 String aFontName;
     389           0 :                 xub_StrLen nPos = 0;
     390           0 :                 while( nPos != STRING_NOTFOUND )
     391             :                 {
     392             :                     // list fo fonts, VCL: semicolon as separator, HTML: comma
     393           0 :                     String aFName = rFace.GetToken( 0, ',', nPos );
     394           0 :                     aFName = comphelper::string::strip(aFName, ' ');
     395           0 :                     if( aFontName.Len() )
     396           0 :                         aFontName += ';';
     397           0 :                     aFontName += aFName;
     398           0 :                 }
     399           0 :                 if ( aFontName.Len() )
     400           0 :                     _rFont.Name = ::rtl::OUString(aFontName);
     401             :             }
     402           0 :             break;
     403             :         case HTML_O_SIZE :
     404             :             {
     405           0 :                 sal_Int16 nSize = (sal_Int16) rOption.GetNumber();
     406           0 :                 if ( nSize == 0 )
     407           0 :                     nSize = 1;
     408           0 :                 else if ( nSize < DBAUI_HTML_FONTSIZES )
     409           0 :                     nSize = DBAUI_HTML_FONTSIZES;
     410             : 
     411           0 :                 _rFont.Height = nSize;
     412             :             }
     413           0 :             break;
     414             :         }
     415             :     }
     416           0 : }
     417             : // ---------------------------------------------------------------------------
     418           0 : sal_Int16 OHTMLReader::GetWidthPixel( const HTMLOption& rOption )
     419             : {
     420             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::GetWidthPixel" );
     421             :     DBG_CHKTHIS(OHTMLReader,NULL);
     422           0 :     const String& rOptVal = rOption.GetString();
     423           0 :     if ( rOptVal.Search('%') != STRING_NOTFOUND )
     424             :     {   // percentage
     425             :         OSL_ENSURE( m_nColumnWidth, "WIDTH Option: m_nColumnWidth==0 und Width%" );
     426           0 :         return (sal_Int16)((rOption.GetNumber() * m_nColumnWidth) / 100);
     427             :     }
     428             :     else
     429             :     {
     430           0 :         if ( rOptVal.Search('*') != STRING_NOTFOUND )
     431             :         {   // relativ to what?!?
     432             : //TODO: collect ColArray of all relevant values and then MakeCol
     433           0 :             return 0;
     434             :         }
     435             :         else
     436           0 :             return (sal_Int16)rOption.GetNumber();  // pixel
     437             :     }
     438             : }
     439             : // ---------------------------------------------------------------------------
     440           0 : sal_Bool OHTMLReader::CreateTable(int nToken)
     441             : {
     442             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::CreateTable" );
     443             :     DBG_CHKTHIS(OHTMLReader,NULL);
     444           0 :     String aTempName(ModuleRes(STR_TBL_TITLE));
     445           0 :     aTempName = aTempName.GetToken(0,' ');
     446           0 :     aTempName = String(::dbtools::createUniqueName(m_xTables,::rtl::OUString(aTempName )));
     447             : 
     448           0 :     int nTmpToken2 = nToken;
     449           0 :     sal_Bool bCaption = sal_False;
     450           0 :     sal_Bool bTableHeader = sal_False;
     451           0 :     String aColumnName;
     452             :     SvxCellHorJustify eVal;
     453             : 
     454           0 :     String aTableName;
     455           0 :     FontDescriptor aFont = ::dbaui::CreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont());
     456           0 :     sal_Int32 nTextColor = 0;
     457           0 :     do
     458             :     {
     459           0 :         switch(nTmpToken2)
     460             :         {
     461             :             case HTML_TEXTTOKEN:
     462             :             case HTML_SINGLECHAR:
     463           0 :                 if(bTableHeader)
     464           0 :                     aColumnName += aToken;
     465           0 :                 if(bCaption)
     466           0 :                     aTableName += aToken;
     467           0 :                 break;
     468             :             case HTML_PARABREAK_OFF:
     469           0 :                 m_sCurrent += aColumnName;
     470           0 :                 break;
     471             :             case HTML_PARABREAK_ON:
     472           0 :                 m_sTextToken.Erase();
     473           0 :                 break;
     474             :             case HTML_TABLEDATA_ON:
     475             :             case HTML_TABLEHEADER_ON:
     476           0 :                 TableDataOn(eVal);
     477           0 :                 bTableHeader = sal_True;
     478           0 :                 break;
     479             :             case HTML_TABLEDATA_OFF:
     480             :             case HTML_TABLEHEADER_OFF:
     481             :                 {
     482           0 :                     aColumnName = comphelper::string::strip(aColumnName, ' ' );
     483           0 :                     if (!aColumnName.Len() || m_bAppendFirstLine )
     484           0 :                         aColumnName = String(ModuleRes(STR_COLUMN_NAME));
     485           0 :                     else if ( m_sCurrent.Len() )
     486           0 :                         aColumnName = m_sCurrent;
     487             : 
     488           0 :                     aColumnName = comphelper::string::strip(aColumnName, ' ');
     489           0 :                     CreateDefaultColumn(aColumnName);
     490           0 :                     aColumnName.Erase();
     491           0 :                     m_sCurrent.Erase();
     492             : 
     493           0 :                     eVal = SVX_HOR_JUSTIFY_STANDARD;
     494           0 :                     bTableHeader = sal_False;
     495             :                 }
     496           0 :                 break;
     497             : 
     498             :             case HTML_TITLE_ON:
     499             :             case HTML_CAPTION_ON:
     500           0 :                 bCaption = sal_True;
     501           0 :                 break;
     502             :             case HTML_TITLE_OFF:
     503             :             case HTML_CAPTION_OFF:
     504           0 :                 aTableName = comphelper::string::strip(aTableName, ' ');
     505           0 :                 if(!aTableName.Len())
     506           0 :                     aTableName = String(::dbtools::createUniqueName(m_xTables,::rtl::OUString(aTableName)));
     507             :                 else
     508           0 :                     aTableName = aTempName;
     509           0 :                 bCaption = sal_False;
     510           0 :                 break;
     511             :             case HTML_FONT_ON:
     512           0 :                 TableFontOn(aFont,nTextColor);
     513           0 :                 break;
     514             :             case HTML_BOLD_ON:
     515           0 :                 aFont.Weight = ::com::sun::star::awt::FontWeight::BOLD;
     516           0 :                 break;
     517             :             case HTML_ITALIC_ON:
     518           0 :                 aFont.Slant = ::com::sun::star::awt::FontSlant_ITALIC;
     519           0 :                 break;
     520             :             case HTML_UNDERLINE_ON:
     521           0 :                 aFont.Underline = ::com::sun::star::awt::FontUnderline::SINGLE;
     522           0 :                 break;
     523             :             case HTML_STRIKE_ON:
     524           0 :                 aFont.Strikeout = ::com::sun::star::awt::FontStrikeout::SINGLE;
     525           0 :                 break;
     526             :         }
     527             :     }
     528           0 :     while((nTmpToken2 = GetNextToken()) != HTML_TABLEROW_OFF);
     529             : 
     530           0 :     if ( m_sCurrent.Len() )
     531           0 :         aColumnName = m_sCurrent;
     532           0 :     aColumnName = comphelper::string::strip(aColumnName, ' ');
     533           0 :     if(aColumnName.Len())
     534           0 :         CreateDefaultColumn(aColumnName);
     535             : 
     536           0 :     if ( m_vDestVector.empty() )
     537           0 :         return sal_False;
     538             : 
     539           0 :     if(!aTableName.Len())
     540           0 :         aTableName = aTempName;
     541             : 
     542           0 :     m_bInTbl        = sal_False;
     543           0 :     m_bFoundTable   = sal_True;
     544             : 
     545           0 :     if ( isCheckEnabled() )
     546           0 :         return sal_True;
     547             : 
     548           0 :     return !executeWizard(aTableName,makeAny(nTextColor),aFont) && m_xTable.is();
     549             : }
     550             : // -----------------------------------------------------------------------------
     551           0 : void OHTMLReader::setTextEncoding()
     552             : {
     553             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::setTextEncoding" );
     554             :     DBG_CHKTHIS(OHTMLReader,NULL);
     555           0 :     m_bMetaOptions = sal_True;
     556           0 :     ParseMetaOptions(NULL, NULL);
     557           0 : }
     558             : 
     559             : // -----------------------------------------------------------------------------
     560           0 : void OHTMLReader::release()
     561             : {
     562             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::release" );
     563             :     DBG_CHKTHIS(OHTMLReader,NULL);
     564           0 :     ReleaseRef();
     565           0 : }
     566             : // -----------------------------------------------------------------------------
     567           0 : TypeSelectionPageFactory OHTMLReader::getTypeSelectionPageFactory()
     568             : {
     569             :     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::getTypeSelectionPageFactory" );
     570             :     DBG_CHKTHIS(OHTMLReader,NULL);
     571           0 :     return &OWizHTMLExtend::Create;
     572             : }
     573             : // -----------------------------------------------------------------------------
     574             : 
     575             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10