[Libreoffice-commits] .: 2 commits - sd/inc sd/source
Olivier Hallot
ohallot at kemper.freedesktop.org
Wed Apr 18 12:12:37 PDT 2012
sd/inc/strmname.h | 20 ++++++++++----------
sd/source/core/drawdoc4.cxx | 3 +--
sd/source/core/sdpage.cxx | 30 +++++++++++++++---------------
sd/source/core/sdpage2.cxx | 2 +-
sd/source/ui/docshell/docshel4.cxx | 23 ++++++++++-------------
5 files changed, 37 insertions(+), 41 deletions(-)
New commits:
commit 8adec08d56a9ad46d3550e43b115e916c4cf783f
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date: Wed Apr 18 16:09:02 2012 -0300
More RTL_CONSTASCII conversions
diff --git a/sd/inc/strmname.h b/sd/inc/strmname.h
index 04de560..ca8aae4 100644
--- a/sd/inc/strmname.h
+++ b/sd/inc/strmname.h
@@ -30,24 +30,24 @@
#define _SD_STRMNAME_H
// Alter Name des Dokument-Streams
-static const String pStarDrawDoc( RTL_CONSTASCII_USTRINGPARAM( "StarDrawDocument" ));
+static const rtl::OUString pStarDrawDoc("StarDrawDocument");
// Name des Dokument-Streams
-static const String pStarDrawDoc3( RTL_CONSTASCII_USTRINGPARAM( "StarDrawDocument3" ));
+static const rtl::OUString pStarDrawDoc3( "StarDrawDocument3" );
// Sonstige
-static const String pSfxStyleSheets( RTL_CONSTASCII_USTRINGPARAM( "SfxStyleSheets" ));
-static const String pVCItemPoolName( RTL_CONSTASCII_USTRINGPARAM( "VCPool" ));
-static const String pPreviewName( RTL_CONSTASCII_USTRINGPARAM( "StarDrawTemplatePreview" ));
+static const rtl::OUString pSfxStyleSheets( "SfxStyleSheets" );
+static const rtl::OUString pVCItemPoolName( "VCPool" );
+static const rtl::OUString pPreviewName( "StarDrawTemplatePreview" );
// PowerPoint-Filter
-static const String pFilterPowerPoint97( RTL_CONSTASCII_USTRINGPARAM( "MS PowerPoint 97" ));
-static const String pFilterPowerPoint97Template( RTL_CONSTASCII_USTRINGPARAM( "MS PowerPoint 97 Vorlage" ));
-static const String pFilterPowerPoint97AutoPlay( RTL_CONSTASCII_USTRINGPARAM( "MS PowerPoint 97 AutoPlay" ));
+static const rtl::OUString pFilterPowerPoint97( "MS PowerPoint 97" );
+static const rtl::OUString pFilterPowerPoint97Template( "MS PowerPoint 97 Vorlage" );
+static const rtl::OUString pFilterPowerPoint97AutoPlay( "MS PowerPoint 97 AutoPlay" );
// XML content stream
-static const String pStarDrawXMLContent( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ));
-static const String pStarDrawOldXMLContent( RTL_CONSTASCII_USTRINGPARAM( "Content.xml" ));
+static const rtl::OUString pStarDrawXMLContent( "content.xml" );
+static const rtl::OUString pStarDrawOldXMLContent( "Content.xml" );
#endif // _SD_STRMNAME_H
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 89d3003..5b0d4c5 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -440,7 +440,7 @@ sal_Bool DrawDocShell::ConvertFrom( SfxMedium& rMedium )
{
mbNewDocument = sal_False;
- const String aFilterName( rMedium.GetFilter()->GetFilterName() );
+ const rtl::OUString aFilterName( rMedium.GetFilter()->GetFilterName() );
sal_Bool bRet = sal_False;
bool bStartPresentation = false;
@@ -469,8 +469,7 @@ sal_Bool DrawDocShell::ConvertFrom( SfxMedium& rMedium )
mpDoc->StopWorkStartupDelay();
bRet = SdPPTFilter( rMedium, *this, sal_True ).Import();
}
- else if (aFilterName.SearchAscii("impress8" ) != STRING_NOTFOUND ||
- aFilterName.SearchAscii("draw8") != STRING_NOTFOUND )
+ else if (aFilterName.match("impress8" ) || aFilterName.match("draw8"))
{
// TODO/LATER: nobody is interested in the error code?!
mpDoc->CreateFirstPages();
@@ -479,7 +478,7 @@ sal_Bool DrawDocShell::ConvertFrom( SfxMedium& rMedium )
bRet = SdXMLFilter( rMedium, *this, sal_True ).Import( nError );
}
- else if (aFilterName.SearchAscii("StarOffice XML (Draw)" ) != STRING_NOTFOUND || aFilterName.SearchAscii("StarOffice XML (Impress)") != STRING_NOTFOUND )
+ else if (aFilterName.match("StarOffice XML (Draw)") || aFilterName.match("StarOffice XML (Impress)"))
{
// TODO/LATER: nobody is interested in the error code?!
mpDoc->CreateFirstPages();
@@ -487,7 +486,7 @@ sal_Bool DrawDocShell::ConvertFrom( SfxMedium& rMedium )
ErrCode nError = ERRCODE_NONE;
bRet = SdXMLFilter( rMedium, *this, sal_True, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60 ).Import( nError );
}
- else if( aFilterName.EqualsAscii( "CGM - Computer Graphics Metafile" ) )
+ else if( aFilterName.equals( "CGM - Computer Graphics Metafile" ) )
{
mpDoc->CreateFirstPages();
mpDoc->StopWorkStartupDelay();
@@ -593,30 +592,28 @@ sal_Bool DrawDocShell::ConvertTo( SfxMedium& rMedium )
if( mpDoc->GetPageCount() )
{
const SfxFilter* pMediumFilter = rMedium.GetFilter();
- const String aTypeName( pMediumFilter->GetTypeName() );
+ const rtl::OUString aTypeName( pMediumFilter->GetTypeName() );
SdFilter* pFilter = NULL;
- if( aTypeName.SearchAscii( "graphic_HTML" ) != STRING_NOTFOUND )
+ if( aTypeName.match( "graphic_HTML" ) )
{
pFilter = new SdHTMLFilter( rMedium, *this, sal_True );
}
- else if( aTypeName.SearchAscii( "MS_PowerPoint_97" ) != STRING_NOTFOUND )
+ else if( aTypeName.match( "MS_PowerPoint_97" ) )
{
pFilter = new SdPPTFilter( rMedium, *this, sal_True );
((SdPPTFilter*)pFilter)->PreSaveBasic();
}
- else if ( aTypeName.SearchAscii( "CGM_Computer_Graphics_Metafile" ) != STRING_NOTFOUND )
+ else if ( aTypeName.match( "CGM_Computer_Graphics_Metafile" ) )
{
pFilter = new SdCGMFilter( rMedium, *this, sal_True );
}
- else if( ( aTypeName.SearchAscii( "draw8" ) != STRING_NOTFOUND ) ||
- ( aTypeName.SearchAscii( "impress8" ) != STRING_NOTFOUND ) )
+ else if( aTypeName.match( "draw8" ) || aTypeName.match( "impress8" ) )
{
pFilter = new SdXMLFilter( rMedium, *this, sal_True );
UpdateDocInfoForSave();
}
- else if( ( aTypeName.SearchAscii( "StarOffice_XML_Impress" ) != STRING_NOTFOUND ) ||
- ( aTypeName.SearchAscii( "StarOffice_XML_Draw" ) != STRING_NOTFOUND ) )
+ else if( aTypeName.match( "StarOffice_XML_Impress" ) || aTypeName.match( "StarOffice_XML_Draw" ) )
{
pFilter = new SdXMLFilter( rMedium, *this, sal_True, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60 );
UpdateDocInfoForSave();
commit 640d0064e427de865484169a275c84d569da64e5
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date: Wed Apr 18 15:11:02 2012 -0300
More RTL_CONSTASCII_ cleanup
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 4540d49..b8489bc 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -553,7 +553,6 @@ void SdDrawDocument::CreateDefaultCellStyles()
SfxStyleSheetBase* pSheet = NULL;
String aHelpFile;
- //const OUString sFamilyName( RTL_CONSTASCII_USTRINGPARAM( "table" ) );
Reference< XNameContainer > xTableFamily( pSSPool->getByName( "table" ), UNO_QUERY );
// ---- Default -----------------------------------------------
@@ -635,7 +634,7 @@ void SdDrawDocument::CreateDefaultCellStyles()
Any aGray2( implMakeSolidCellStyle( pSSPool, "gray2" , aDefaultCellStyleName, RGB_COLORDATA(204,204,204)));
Any aGray3( implMakeSolidCellStyle( pSSPool, "gray3" , aDefaultCellStyleName, RGB_COLORDATA(179,179,179)));
- implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("default") ), aGray1, aGray3, aGray2 );
+ implCreateTableTemplate( xTableFamily, "default" , aGray1, aGray3, aGray2 );
// ---- BW ------------------------------------------------
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index e1aab55..aa1a8b6 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2376,7 +2376,7 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO
// to inside this method to work even when outliner is fetched here.
pOutl->SetStyleSheet(0, pObj->GetStyleSheet());
- String aString;
+ rtl::OUString aString;
switch( eObjKind )
{
@@ -2384,29 +2384,29 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO
{
pOutl->Init( OUTLINERMODE_OUTLINEOBJECT );
- aString += sal_Unicode( '\t' );
+ aString += "\t";
aString += rString;
if (mbMaster)
{
pOutl->SetStyleSheet( 0, GetStyleSheetForPresObj(eObjKind) );
- aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\n\t\t" ));
- aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER2 ) );
+ aString += "\n\t\t";
+ aString += ResId::toString( SdResId( STR_PRESOBJ_MPOUTLLAYER2 ) );
- aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\n\t\t\t" ));
- aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER3 ) );
+ aString += "\n\t\t\t";
+ aString += ResId::toString( SdResId( STR_PRESOBJ_MPOUTLLAYER3 ) );
- aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\n\t\t\t\t" ));
- aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER4 ) );
+ aString += "\n\t\t\t\t";
+ aString += ResId::toString( SdResId( STR_PRESOBJ_MPOUTLLAYER4 ) );
- aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\n\t\t\t\t\t" ));
- aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER5 ) );
+ aString += "\n\t\t\t\t\t";
+ aString += ResId::toString( SdResId( STR_PRESOBJ_MPOUTLLAYER5 ) );
- aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\n\t\t\t\t\t\t" ));
- aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER6 ) );
+ aString += "\n\t\t\t\t\t\t";
+ aString += ResId::toString( SdResId( STR_PRESOBJ_MPOUTLLAYER6 ) );
- aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\n\t\t\t\t\t\t\t" ));
- aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER7 ) );
+ aString += "\n\t\t\t\t\t\t\t";
+ aString += ResId::toString( SdResId( STR_PRESOBJ_MPOUTLLAYER7 ) );
}
}
@@ -2458,7 +2458,7 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO
pOutl->SetPaperSize( pObj->GetLogicRect().GetSize() );
- if( aString.Len() )
+ if( !aString.isEmpty() )
pOutl->SetText( aString, pOutl->GetParagraph( 0 ) );
( (SdrTextObj*) pObj)->SetOutlinerParaObject( pOutl->CreateParaObject() );
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index 0159b14..73b9441 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -621,7 +621,7 @@ void SdPage::addAnnotation( const Reference< XAnnotation >& xAnnotation, int nIn
{
pModel->SetChanged();
Reference< XInterface > xSource( xAnnotation, UNO_QUERY );
- NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAnnotationInserted" ) ), xSource );
+ NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), "OnAnnotationInserted" , xSource );
}
}
More information about the Libreoffice-commits
mailing list