ditch slightly suboptimal C2S define

Change-Id: I51abdf8539801f6d93cdc1a21a7e0e1a3d5ef785
This commit is contained in:
Caolán McNamara 2012-06-27 23:53:28 +01:00
parent 694e2cbf9d
commit 83f50e3f21
10 changed files with 26 additions and 29 deletions

View file

@ -38,9 +38,6 @@
class String;
#define C2S(cChar) String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(cChar))
/////////////////////////////////////////////////////////////////
inline long SmPtsTo100th_mm(long nNumPts)

View file

@ -391,14 +391,14 @@ EditEngine& SmDocShell::GetEditEngine()
pEditEngine->EnableUndo( true );
pEditEngine->SetDefTab( sal_uInt16(
Application::GetDefaultDevice()->GetTextWidth( C2S("XXXX") ) ) );
Application::GetDefaultDevice()->GetTextWidth(rtl::OUString("XXXX"))) );
pEditEngine->SetControlWord(
(pEditEngine->GetControlWord() | EE_CNTRL_AUTOINDENTING) &
(~EE_CNTRL_UNDOATTRIBS) &
(~EE_CNTRL_PASTESPECIAL) );
pEditEngine->SetWordDelimiters( C2S(" .=+-*/(){}[];\"" ) );
pEditEngine->SetWordDelimiters( rtl::OUString(" .=+-*/(){}[];\"" ) );
pEditEngine->SetRefMapMode( MAP_PIXEL );
pEditEngine->SetPaperSize( Size( 800, 0 ) );
@ -777,7 +777,7 @@ sal_Bool SmDocShell::ConvertFrom(SfxMedium &rMedium)
if ( SotStorage::IsStorageFile( pStream ) )
{
SvStorageRef aStorage = new SotStorage( pStream, false );
if ( aStorage->IsStream( C2S( "Equation Native" ) ) )
if ( aStorage->IsStream(rtl::OUString("Equation Native")) )
{
// is this a MathType Storage?
MathType aEquation( aText );
@ -824,12 +824,12 @@ sal_Bool SmDocShell::Load( SfxMedium& rMedium )
uno::Reference < container::XNameAccess > xAccess (xStorage, uno::UNO_QUERY);
if (
(
xAccess->hasByName( C2S( "content.xml" ) ) &&
xStorage->isStreamElement( C2S( "content.xml" ) )
xAccess->hasByName( rtl::OUString("content.xml") ) &&
xStorage->isStreamElement( rtl::OUString("content.xml") )
) ||
(
xAccess->hasByName( C2S( "Content.xml" ) ) &&
xStorage->isStreamElement( C2S( "Content.xml" ) )
xAccess->hasByName( rtl::OUString("Content.xml") ) &&
xStorage->isStreamElement( rtl::OUString("Content.xml") )
)
)
{

View file

@ -239,7 +239,7 @@ void SmEditWindow::DataChanged( const DataChangedEvent& )
//! see also SmDocShell::GetEditEngine() !
//!
pEditEngine->SetDefTab( sal_uInt16( GetTextWidth( C2S("XXXX") ) ) );
pEditEngine->SetDefTab(sal_uInt16(GetTextWidth(rtl::OUString("XXXX"))));
SetEditEngineDefaultFonts(*pEditEngineItemPool);
@ -771,7 +771,7 @@ void SmEditWindow::SelNextMark()
{
ESelection eSelection = pEditView->GetSelection();
sal_uInt16 Pos = eSelection.nEndPos;
String aMark (C2S("<?>"));
rtl::OUString aMark("<?>");
String aText;
sal_uInt16 nCounts = pEditEngine->GetParagraphCount();
@ -803,7 +803,7 @@ void SmEditWindow::SelPrevMark()
sal_uInt16 Pos = STRING_NOTFOUND;
xub_StrLen Max = eSelection.nStartPos;
String Text( pEditEngine->GetText( eSelection.nStartPara ) );
String aMark (C2S("<?>"));
rtl::OUString aMark("<?>");
sal_uInt16 nCounts = pEditEngine->GetParagraphCount();
do

View file

@ -148,10 +148,10 @@ SmFormat::SmFormat()
vFont[FNT_FUNCTION] =
vFont[FNT_NUMBER] =
vFont[FNT_TEXT] =
vFont[FNT_SERIF] = SmFace(C2S(FNTNAME_TIMES), aBaseSize);
vFont[FNT_SANS] = SmFace(C2S(FNTNAME_HELV), aBaseSize);
vFont[FNT_FIXED] = SmFace(C2S(FNTNAME_COUR), aBaseSize);
vFont[FNT_MATH] = SmFace(C2S(FNTNAME_MATH), aBaseSize);
vFont[FNT_SERIF] = SmFace(rtl::OUString(FNTNAME_TIMES), aBaseSize);
vFont[FNT_SANS] = SmFace(rtl::OUString(FNTNAME_HELV), aBaseSize);
vFont[FNT_FIXED] = SmFace(rtl::OUString(FNTNAME_COUR), aBaseSize);
vFont[FNT_MATH] = SmFace(rtl::OUString(FNTNAME_MATH), aBaseSize);
vFont[FNT_MATH].SetCharSet( RTL_TEXTENCODING_UNICODE );

View file

@ -1912,7 +1912,7 @@ int MathType::ConvertFromStarMath( SfxMedium& rMedium )
SvGlobalName aGName(0x0002ce02L, 0x0000, 0x0000,0xc0,0x00,
0x00,0x00,0x00,0x00,0x00,0x46 );
pStor->SetClass( aGName, 0, C2S("Microsoft Equation 3.0"));
pStor->SetClass( aGName, 0, rtl::OUString("Microsoft Equation 3.0"));
static sal_uInt8 const aCompObj[] = {
0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
@ -1929,7 +1929,7 @@ int MathType::ConvertFromStarMath( SfxMedium& rMedium )
0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
SvStorageStreamRef xStor( pStor->OpenSotStream( C2S("\1CompObj")));
SvStorageStreamRef xStor( pStor->OpenSotStream(rtl::OUString("\1CompObj")));
xStor->Write(aCompObj,sizeof(aCompObj));
static sal_uInt8 const aOle[] = {
@ -1937,12 +1937,12 @@ int MathType::ConvertFromStarMath( SfxMedium& rMedium )
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
SvStorageStreamRef xStor2( pStor->OpenSotStream( C2S("\1Ole")));
SvStorageStreamRef xStor2( pStor->OpenSotStream(rtl::OUString("\1Ole")));
xStor2->Write(aOle,sizeof(aOle));
xStor.Clear();
xStor2.Clear();
SvStorageStreamRef xSrc = pStor->OpenSotStream(C2S("Equation Native"));
SvStorageStreamRef xSrc = pStor->OpenSotStream(rtl::OUString("Equation Native"));
if ( (!xSrc.Is()) || (SVSTREAM_OK != xSrc->GetError()))
return 0;

View file

@ -881,7 +881,7 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
SmTmpDevice aTmpDev ((OutputDevice &) rDev, sal_True);
aTmpDev.SetFont(GetFont());
SmRect aRect = (SmRect(aTmpDev, &rFormat, C2S("a"),
SmRect aRect = (SmRect(aTmpDev, &rFormat, rtl::OUString("a"),
GetFont().GetBorderWidth()));
nFormulaBaseline = GetAlignM();
// move from middle position by constant - distance
@ -941,7 +941,7 @@ void SmLineNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
//! be sure to use a character that has explicitly defined HiAttribut
//! line in rect.cxx such as 'a' in order to make 'vec a' look same to
//! 'vec {a}'.
SmRect::operator = (SmRect(aTmpDev, &rFormat, C2S("a"),
SmRect::operator = (SmRect(aTmpDev, &rFormat, rtl::OUString("a"),
GetFont().GetBorderWidth()));
// make sure that the rectangle occupies (almost) no space
SetWidth(1);

View file

@ -304,7 +304,7 @@ SmFilterDetect::~SmFilterDetect()
SotStorageRef aStorage = new SotStorage ( pStrm, sal_False );
if ( !aStorage->GetError() )
{
if ( aStorage->IsStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Equation Native" ) ) ) )
if (aStorage->IsStream(rtl::OUString("Equation Native")))
{
sal_uInt8 nVersion;
if (GetMathTypeVersion( aStorage, nVersion ) && nVersion <=3)

View file

@ -235,7 +235,7 @@ SmModule::SmModule(SfxObjectFactory* pObjFact) :
pSysLocale( 0 ),
pVirtualDev( 0 )
{
SetName( C2S("StarMath" ));
SetName(rtl::OUString("StarMath"));
SvxModifyControl::RegisterControl(SID_DOC_MODIFIED, this);
}

View file

@ -56,8 +56,8 @@ using namespace ::rtl;
/**************************************************************************/
SmSym::SmSym() :
m_aName(C2S("unknown")),
m_aSetName(C2S("unknown")),
m_aName(rtl::OUString("unknown")),
m_aSetName(rtl::OUString("unknown")),
m_cChar('\0'),
m_bPredefined(false),
m_bDocSymbol(false)

View file

@ -1520,7 +1520,7 @@ bool SmViewShell::Insert( SfxMedium& rMedium )
uno::Reference< container::XNameAccess > xNameAccess( xStorage, uno::UNO_QUERY );
if ( xNameAccess.is() && xNameAccess->getElementNames().getLength() )
{
if ( xNameAccess->hasByName( C2S( "content.xml" ) ) || xNameAccess->hasByName( C2S( "Content.xml" ) ))
if ( xNameAccess->hasByName( rtl::OUString("content.xml") ) || xNameAccess->hasByName( rtl::OUString("Content.xml") ))
{
// is this a fabulous math package ?
Reference<com::sun::star::frame::XModel> xModel(pDoc->GetModel());
@ -2026,7 +2026,7 @@ SmViewShell::SmViewShell(SfxViewFrame *pFrame_, SfxViewShell *):
SetStatusText(String());
SetWindow(&aGraphic);
SfxShell::SetName(C2S("SmView"));
SfxShell::SetName(rtl::OUString("SmView"));
SfxShell::SetUndoManager( &GetDoc()->GetEditEngine().GetUndoManager() );
SetHelpId( HID_SMA_VIEWSHELL_DOCUMENT );
}