diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-27 23:53:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-06-28 13:53:36 +0100 |
commit | 83f50e3f2118746232f7fe115805ee967c1ffcee (patch) | |
tree | 86f120413cad004a0acb33d9f6894127e13527bb /starmath | |
parent | There's no reason for GetDefaultContentType to be virtual (diff) | |
download | core-83f50e3f2118746232f7fe115805ee967c1ffcee.tar.gz core-83f50e3f2118746232f7fe115805ee967c1ffcee.zip |
ditch slightly suboptimal C2S define
Change-Id: I51abdf8539801f6d93cdc1a21a7e0e1a3d5ef785
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/utility.hxx | 3 | ||||
-rw-r--r-- | starmath/source/document.cxx | 14 | ||||
-rw-r--r-- | starmath/source/edit.cxx | 6 | ||||
-rw-r--r-- | starmath/source/format.cxx | 8 | ||||
-rw-r--r-- | starmath/source/mathtype.cxx | 8 | ||||
-rw-r--r-- | starmath/source/node.cxx | 4 | ||||
-rw-r--r-- | starmath/source/smdetect.cxx | 2 | ||||
-rw-r--r-- | starmath/source/smmod.cxx | 2 | ||||
-rw-r--r-- | starmath/source/symbol.cxx | 4 | ||||
-rw-r--r-- | starmath/source/view.cxx | 4 |
10 files changed, 26 insertions, 29 deletions
diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx index 9d4f2ed6fa55..34ca97c56874 100644 --- a/starmath/inc/utility.hxx +++ b/starmath/inc/utility.hxx @@ -38,9 +38,6 @@ class String; -#define C2S(cChar) String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(cChar)) - - ///////////////////////////////////////////////////////////////// inline long SmPtsTo100th_mm(long nNumPts) diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 5cef94519855..b6510284db6e 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -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") ) ) ) { diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 856ffdca5c83..d42a0f54e1dd 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -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 diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx index e65d1d55d6e2..1a058a047f95 100644 --- a/starmath/source/format.cxx +++ b/starmath/source/format.cxx @@ -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 ); diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 76ecaf444cdf..1bff46f03b9c 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -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; diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index e05f188792fd..92e8b1bcd107 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -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); diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx index 05f6056821c5..6d51ae5503bd 100644 --- a/starmath/source/smdetect.cxx +++ b/starmath/source/smdetect.cxx @@ -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) diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx index 0307509b847f..377cbeb8ccf9 100644 --- a/starmath/source/smmod.cxx +++ b/starmath/source/smmod.cxx @@ -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); } diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 6e98f6e7ee1b..58644abe1578 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -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) diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 89e20db05f66..8bf8a55d687a 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -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 ); } |