[Libreoffice-commits] .: 2 commits - sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Aug 3 21:45:14 PDT 2011
sc/source/filter/html/htmlimp.cxx | 2 +-
sc/source/filter/html/htmlpars.cxx | 30 +++++++++++++++---------------
sc/source/filter/inc/htmlpars.hxx | 30 ++++++++++++++----------------
3 files changed, 30 insertions(+), 32 deletions(-)
New commits:
commit 0716d1891116a8de8d13ea9416464f4b23a57585
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Thu Aug 4 00:45:25 2011 -0400
More String removal.
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 1108dd6..69092bc 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -3021,7 +3021,7 @@ void ScHTMLQueryParser::InsertText( const ImportInfo& rInfo )
{
mpCurrTable->PutText( rInfo );
if( mbTitleOn )
- maTitle.Append( rInfo.aText );
+ maTitle.append(rInfo.aText);
}
void ScHTMLQueryParser::FontOn( const ImportInfo& rInfo )
@@ -3084,19 +3084,20 @@ void ScHTMLQueryParser::MetaOn( const ImportInfo& rInfo )
void ScHTMLQueryParser::TitleOn( const ImportInfo& /*rInfo*/ )
{
mbTitleOn = true;
- maTitle.Erase();
+ maTitle.makeStringAndClear();
}
void ScHTMLQueryParser::TitleOff( const ImportInfo& rInfo )
{
if( mbTitleOn )
{
- maTitle.EraseLeadingAndTrailingChars();
- if( maTitle.Len() && mpDoc->GetDocumentShell() ) {
+ rtl::OUString aTitle = maTitle.makeStringAndClear().trim();
+ if (!aTitle.isEmpty() && mpDoc->GetDocumentShell())
+ {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
mpDoc->GetDocumentShell()->GetModel(), uno::UNO_QUERY_THROW);
- xDPS->getDocumentProperties()->setTitle(maTitle);
+ xDPS->getDocumentProperties()->setTitle(aTitle);
}
InsertText( rInfo );
mbTitleOn = false;
diff --git a/sc/source/filter/inc/htmlpars.hxx b/sc/source/filter/inc/htmlpars.hxx
index 712d372..23a1ad1 100644
--- a/sc/source/filter/inc/htmlpars.hxx
+++ b/sc/source/filter/inc/htmlpars.hxx
@@ -664,7 +664,7 @@ private:
private:
typedef ::std::auto_ptr< ScHTMLGlobalTable > ScHTMLGlobalTablePtr;
- String maTitle; /// The title of the document.
+ rtl::OUStringBuffer maTitle; /// The title of the document.
ScHTMLGlobalTablePtr mxGlobTable; /// Contains the entire imported document.
ScHTMLTable* mpCurrTable; /// Pointer to current table (performance).
ScHTMLTableId mnUnusedId; /// First unused table identifier.
commit be2c818394353b602a490bf955ff259abdb1d503
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Thu Aug 4 00:36:58 2011 -0400
More String / sal_Bool removal.
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx
index c174b57..2f87cee 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -206,7 +206,7 @@ void ScHTMLImport::WriteToDocument(
// insert table number as name
InsertRangeName( mpDoc, ScfTools::GetNameFromHTMLIndex( nTableId ), aNewRange );
// insert table id as name
- if( pTable->GetTableName().Len() )
+ if (!pTable->GetTableName().isEmpty())
{
String aName( ScfTools::GetNameFromHTMLName( pTable->GetTableName() ) );
if (!mpDoc->GetRangeName()->findByName(aName))
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 9b1a3ba..1108dd6 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -239,7 +239,7 @@ ScHTMLLayoutParser::ScHTMLLayoutParser(
nMetaCnt(0),
nOffsetTolerance( SC_HTML_OFFSET_TOLERANCE_SMALL ),
bTabInTabCell( false ),
- bFirstRow( sal_True ),
+ bFirstRow( true ),
bInCell( false ),
bInTitle( false )
{
@@ -910,7 +910,7 @@ IMPL_LINK( ScHTMLLayoutParser, HTMLImportHdl, ImportInfo*, pInfo )
{
bInCell = false;
NextRow( pInfo );
- bInCell = sal_True;
+ bInCell = true;
}
CloseEntry( pInfo );
}
@@ -973,7 +973,7 @@ void ScHTMLLayoutParser::TableDataOn( ImportInfo* pInfo )
OSL_FAIL( "Dummbatz-Dok! <TH> oder <TD> ohne vorheriges <TABLE>" );
TableOn( pInfo );
}
- bInCell = sal_True;
+ bInCell = true;
sal_Bool bHorJustifyCenterTH = (pInfo->nToken == HTML_TABLEHEADER_ON);
const HTMLOptions& rOptions = static_cast<HTMLParser*>(pInfo->pParser)->GetOptions();
for (size_t i = 0, n = rOptions.size(); i < n; ++i)
@@ -1333,8 +1333,8 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo )
pActEntry = pE;
delete pS;
}
- bTabInTabCell = sal_True;
- bInCell = sal_True;
+ bTabInTabCell = true;
+ bInCell = true;
}
else
{ // einfache Table beendet
@@ -1586,17 +1586,16 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo )
break;
case HTML_TITLE_ON:
{
- bInTitle = sal_True;
- aString.Erase();
+ bInTitle = true;
+ aString = rtl::OUString();
}
break;
case HTML_TITLE_OFF:
{
- if ( bInTitle && aString.Len() )
+ if ( bInTitle && !aString.isEmpty() )
{
// Leerzeichen von Zeilenumbruechen raus
- aString.EraseLeadingChars();
- aString.EraseTrailingChars();
+ aString = aString.trim();
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
mpDoc->GetDocumentShell()->GetModel(),
uno::UNO_QUERY_THROW);
diff --git a/sc/source/filter/inc/htmlpars.hxx b/sc/source/filter/inc/htmlpars.hxx
index 85dbd99..712d372 100644
--- a/sc/source/filter/inc/htmlpars.hxx
+++ b/sc/source/filter/inc/htmlpars.hxx
@@ -168,9 +168,9 @@ class ScHTMLLayoutParser : public ScHTMLParser
{
private:
Size aPageSize;
- String aBaseURL;
+ rtl::OUString aBaseURL;
ScHTMLTableStack aTableStack;
- String aString;
+ rtl::OUString aString;
ScRangeListRef xLockedList; // je Table
Table* pTables;
ScHTMLColOffset* pColOffset;
@@ -186,12 +186,10 @@ private:
sal_uInt16 nColOffsetStart; // Startwert je Table, in Pixel
sal_uInt16 nMetaCnt; // fuer ParseMetaOptions
sal_uInt16 nOffsetTolerance; // for use with SeekOffset and related
- sal_Bool bCalcWidthHeight; // TRUE: calculate real column width
- // FALSE: 1 html-col = 1 sc-col
- sal_Bool bTabInTabCell;
- sal_Bool bFirstRow; // je Table, ob in erster Zeile
- sal_Bool bInCell;
- sal_Bool bInTitle;
+ bool bTabInTabCell:1;
+ bool bFirstRow:1; // je Table, ob in erster Zeile
+ bool bInCell:1;
+ bool bInTitle:1;
DECL_LINK( HTMLImportHdl, ImportInfo* );
void NewActEntry( ScEEParseEntry* );
@@ -388,7 +386,7 @@ public:
virtual ~ScHTMLTable();
/** Returns the name of the table, specified in the TABLE tag. */
- inline const String& GetTableName() const { return maTableName; }
+ inline const rtl::OUString& GetTableName() const { return maTableName; }
/** Returns the unique identifier of the table. */
inline ScHTMLTableId GetTableId() const { return maTableId.mnTableId; }
/** Returns the table size. */
@@ -571,7 +569,7 @@ private:
private:
ScHTMLTable* mpParentTable; /// Pointer to parent table.
ScHTMLTableMapPtr mxNestedTables; /// Table of nested HTML tables.
- String maTableName; /// Table name from <table id> option.
+ rtl::OUString maTableName; /// Table name from <table id> option.
ScHTMLTableAutoId maTableId; /// Unique identifier of this table.
SfxItemSet maTableItemSet; /// Items for the entire table.
SfxItemSetPtr mxRowItemSet; /// Items for the current table row.
@@ -589,11 +587,11 @@ private:
ScHTMLPos maCurrCell; /// Address of current cell to fill.
ScHTMLPos maDocBasePos; /// Resulting base address in a Calc document.
ScHTMLParser* mpParser;
- bool mbBorderOn; /// true = Table borders on.
- bool mbPreFormText; /// true = Table from preformatted text (<pre> tag).
- bool mbRowOn; /// true = Inside of <tr> </tr>.
- bool mbDataOn; /// true = Inside of <td> </td> or <th> </th>.
- bool mbPushEmptyLine; /// true = Insert empty line before current entry.
+ bool mbBorderOn:1; /// true = Table borders on.
+ bool mbPreFormText:1; /// true = Table from preformatted text (<pre> tag).
+ bool mbRowOn:1; /// true = Inside of <tr> </tr>.
+ bool mbDataOn:1; /// true = Inside of <td> </td> or <th> </th>.
+ bool mbPushEmptyLine:1; /// true = Insert empty line before current entry.
};
// ----------------------------------------------------------------------------
More information about the Libreoffice-commits
mailing list