[Libreoffice-commits] .: sw/source
Thomas Arnhold
tarnhold at kemper.freedesktop.org
Fri Jan 28 07:46:35 PST 2011
sw/source/core/crsr/pam.cxx | 2 -
sw/source/core/text/portxt.cxx | 8 +++---
sw/source/core/unocore/unochart.cxx | 8 +++---
sw/source/filter/ww8/wrtw8nds.cxx | 42 ++++++++++++++++++------------------
sw/source/filter/ww8/wrtww8.cxx | 12 ++++++----
sw/source/ui/docvw/edtwin.cxx | 4 +--
6 files changed, 39 insertions(+), 37 deletions(-)
New commits:
commit e74ac8257f4a4e096f4bc2bbf2a3b7b4cd411c8c
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Fri Jan 28 16:46:24 2011 +0100
Replace suitable equalsAscii calls with equalsAsciiL.
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 5349974..1f18802 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -819,7 +819,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
sw::mark::IFieldmark* pFieldmark = pMarksAccess->getFieldmarkFor( *GetPoint() );
if ( pFieldmark )
- bUnhandledMark = pFieldmark->GetFieldname( ).equalsAscii( ODF_UNHANDLED );
+ bUnhandledMark = pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) );
}
if (!bRet)
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 624aab8..4af4b7e 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -824,13 +824,13 @@ void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const
if ( pBM != NULL )
{
- if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) )
+ if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) )
{ // a checkbox...
ICheckboxFieldmark* pCheckboxFm = dynamic_cast< ICheckboxFieldmark* >(pBM);
bool checked = pCheckboxFm->IsChecked();
rInf.DrawCheckBox(*this, checked);
}
- else if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) )
+ else if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) )
{ // a list...
rtl::OUString aTxt;
rInf.DrawViewOpt( *this, POR_FLD );
@@ -854,13 +854,13 @@ sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo & rInf )
OSL_ENSURE( pBM != NULL, "Where is my form field bookmark???" );
if ( pBM != NULL )
{
- if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) )
+ if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) )
{
Width( rInf.GetTxtHeight( ) );
Height( rInf.GetTxtHeight( ) );
SetAscent( rInf.GetAscent( ) );
}
- else if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) )
+ else if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) )
{
::rtl::OUString aTxt;
getCurrentListIndex( pBM, &aTxt );
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 0a979ff..bf7aaa9 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -1546,7 +1546,7 @@ sal_Bool SAL_CALL SwChartDataProvider::supportsService(
throw (uno::RuntimeException)
{
SolarMutexGuard aGuard;
- return rServiceName.equalsAscii( SN_DATA_PROVIDER );
+ return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SN_DATA_PROVIDER ) );
}
uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames( )
@@ -1943,7 +1943,7 @@ sal_Bool SAL_CALL SwChartDataSource::supportsService(
throw (uno::RuntimeException)
{
SolarMutexGuard aGuard;
- return rServiceName.equalsAscii( SN_DATA_SOURCE );
+ return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SN_DATA_SOURCE ) );
}
uno::Sequence< OUString > SAL_CALL SwChartDataSource::getSupportedServiceNames( )
@@ -2408,7 +2408,7 @@ sal_Bool SAL_CALL SwChartDataSequence::supportsService(
const OUString& rServiceName )
throw (uno::RuntimeException)
{
- return rServiceName.equalsAscii( SN_DATA_SEQUENCE );
+ return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SN_DATA_SEQUENCE ) );
}
uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames( )
@@ -2891,7 +2891,7 @@ sal_Bool SAL_CALL SwChartLabeledDataSequence::supportsService(
const OUString& rServiceName )
throw (uno::RuntimeException)
{
- return rServiceName.equalsAscii( SN_LABELED_DATA_SEQUENCE );
+ return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SN_LABELED_DATA_SEQUENCE ) );
}
uno::Sequence< OUString > SAL_CALL SwChartLabeledDataSequence::getSupportedServiceNames( )
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index f18c125..8d6cd56 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -119,17 +119,17 @@ using namespace nsFieldFlags;
static String lcl_getFieldCode( const IFieldmark* pFieldmark ) {
OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???");
- if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMTEXT ) ) {
+ if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
return String::CreateFromAscii(" FORMTEXT ");
- } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) ) {
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) {
return String::CreateFromAscii(" FORMDROPDOWN ");
- } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) ) {
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) {
return String::CreateFromAscii(" FORMCHECKBOX ");
- } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_TOC ) ) {
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_TOC ) ) ) {
return String::CreateFromAscii(" TOC ");
- } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_HYPERLINK ) ) {
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) ) {
return String::CreateFromAscii(" HYPERLINK ");
- } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_PAGEREF ) ) {
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_PAGEREF ) ) ) {
return String::CreateFromAscii(" PAGEREF ");
} else {
return pFieldmark->GetFieldname();
@@ -138,17 +138,17 @@ static String lcl_getFieldCode( const IFieldmark* pFieldmark ) {
ww::eField lcl_getFieldId( const IFieldmark* pFieldmark ) {
OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???");
- if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMTEXT ) ) {
+ if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
return ww::eFORMTEXT;
- } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) ) {
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) {
return ww::eFORMDROPDOWN;
- } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) ) {
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) {
return ww::eFORMCHECKBOX;
- } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_TOC ) ) {
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_TOC ) ) ) {
return ww::eTOC;
- } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_HYPERLINK ) ) {
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) ) {
return ww::eHYPERLINK;
- } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_PAGEREF ) ) {
+ } else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_PAGEREF ) ) ) {
return ww::ePAGEREF;
} else {
return ww::eUNKNOWN;
@@ -1831,11 +1831,11 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
- if ( pFieldmark->GetFieldname().equalsAscii( ODF_FORMTEXT ) )
+ if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
AppendBookmark( pFieldmark->GetName(), false );
ww::eField eFieldId = lcl_getFieldId( pFieldmark );
String sCode = lcl_getFieldCode( pFieldmark );
- if ( pFieldmark->GetFieldname().equalsAscii( ODF_UNHANDLED ) )
+ if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
{
IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) );
@@ -1856,13 +1856,13 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
}
}
OutputField( NULL, eFieldId, sCode, WRITEFIELD_START | WRITEFIELD_CMD_START );
- if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMTEXT ) )
+ if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
WriteFormData( *pFieldmark );
- else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_HYPERLINK ) )
+ else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) )
WriteHyperlinkData( *pFieldmark );
OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CMD_END );
- if ( pFieldmark->GetFieldname().equalsAscii( ODF_UNHANDLED ) )
+ if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
{
// Check for the presence of a linked OLE object
IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
@@ -1884,7 +1884,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDEND??" );
ww::eField eFieldId = lcl_getFieldId( pFieldmark );
- if ( pFieldmark->GetFieldname().equalsAscii( ODF_UNHANDLED ) )
+ if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
{
IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) );
@@ -1897,7 +1897,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
}
OutputField( NULL, eFieldId, String(), WRITEFIELD_CLOSE );
- if ( pFieldmark->GetFieldname().equalsAscii( ODF_FORMTEXT ) )
+ if ( pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
AppendBookmark( pFieldmark->GetName(), false );
}
else if ( ch == CH_TXT_ATR_FORMELEMENT )
@@ -1906,8 +1906,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
- bool isDropdownOrCheckbox = pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) ||
- pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX );
+ bool isDropdownOrCheckbox = pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ||
+ pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) );
if ( isDropdownOrCheckbox )
AppendBookmark( pFieldmark->GetName(), 0 );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index a219792..c8fe531 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3515,16 +3515,18 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
const ::sw::mark::ICheckboxFieldmark* pAsCheckbox = dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( pFieldmark );
- OSL_ENSURE(rFieldmark.GetFieldname().equalsAscii( ODF_FORMTEXT ) || rFieldmark.GetFieldname().equalsAscii( ODF_FORMDROPDOWN ) || rFieldmark.GetFieldname().equalsAscii( ODF_FORMCHECKBOX ), "Unknown field type!!!");
- if ( ! ( rFieldmark.GetFieldname().equalsAscii( ODF_FORMTEXT ) ||
- rFieldmark.GetFieldname().equalsAscii( ODF_FORMDROPDOWN ) ||
- rFieldmark.GetFieldname().equalsAscii( ODF_FORMCHECKBOX ) ) )
+ OSL_ENSURE(rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ||
+ rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ||
+ rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ), "Unknown field type!!!");
+ if ( ! ( rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ||
+ rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ||
+ rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) )
return;
int type = 0; // TextFieldmark
if ( pAsCheckbox )
type = 1;
- if ( rFieldmark.GetFieldname().equalsAscii( ODF_FORMDROPDOWN ) )
+ if ( rFieldmark.GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) )
type=2;
::sw::mark::IFieldmark::parameter_map_t::const_iterator pNameParameter = rFieldmark.GetParameters()->find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")));
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 3ecabc7..d7d980a 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -4126,13 +4126,13 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if ( aCntntAtPos.aFnd.pFldmark != NULL)
{
IFieldmark *fieldBM = const_cast< IFieldmark* > ( aCntntAtPos.aFnd.pFldmark );
- if (fieldBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) )
+ if (fieldBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) )
{
ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(fieldBM);
pCheckboxFm->SetChecked(!pCheckboxFm->IsChecked());
pCheckboxFm->Invalidate();
rSh.InvalidateWindows( rView.GetVisArea() );
- } else if (fieldBM->GetFieldname().equalsAscii( ODF_FORMDROPDOWN) ) {
+ } else if (fieldBM->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) {
rView.ExecFieldPopup( aDocPt, fieldBM );
fieldBM->Invalidate();
rSh.InvalidateWindows( rView.GetVisArea() );
More information about the Libreoffice-commits
mailing list